Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / public / platform / WebServiceWorkerResponse.h
index 30b82ad..e119abf 100644 (file)
@@ -8,20 +8,20 @@
 #include "WebCommon.h"
 #include "public/platform/WebPrivatePtr.h"
 #include "public/platform/WebString.h"
+#include "public/platform/WebURL.h"
 #include "public/platform/WebVector.h"
 
 #if INSIDE_BLINK
 #include "wtf/Forward.h"
 #include "wtf/HashMap.h"
 #include "wtf/text/StringHash.h"
-
-namespace WebCore {
-class BlobDataHandle;
-}
 #endif
 
 namespace blink {
 
+class BlobDataHandle;
+class HTTPHeaderMap;
+class WebHTTPHeaderVisitor;
 class WebServiceWorkerResponsePrivate;
 
 // Represents a response to a fetch operation. ServiceWorker uses this to
@@ -31,6 +31,7 @@ class BLINK_PLATFORM_EXPORT WebServiceWorkerResponse {
 public:
     ~WebServiceWorkerResponse() { reset(); }
     WebServiceWorkerResponse();
+    WebServiceWorkerResponse(const WebServiceWorkerResponse& other) { assign(other); }
     WebServiceWorkerResponse& operator=(const WebServiceWorkerResponse& other)
     {
         assign(other);
@@ -40,6 +41,9 @@ public:
     void reset();
     void assign(const WebServiceWorkerResponse&);
 
+    void setURL(const WebURL&);
+    WebURL url() const;
+
     void setStatus(unsigned short);
     unsigned short status() const;
 
@@ -47,17 +51,22 @@ public:
     WebString statusText() const;
 
     void setHeader(const WebString& key, const WebString& value);
+
+    // If the key already exists, appends the value to the same key (comma
+    // delimited) else creates a new entry.
+    void appendHeader(const WebString& key, const WebString& value);
+
     WebVector<WebString> getHeaderKeys() const;
     WebString getHeader(const WebString& key) const;
+    void visitHTTPHeaderFields(WebHTTPHeaderVisitor*) const;
 
     WebString blobUUID() const;
 
 #if INSIDE_BLINK
-    void setHeaders(const HashMap<String, String>&);
-    const HashMap<String, String>& headers() const;
+    const HTTPHeaderMap& headers() const;
 
-    void setBlobDataHandle(PassRefPtr<WebCore::BlobDataHandle>);
-    PassRefPtr<WebCore::BlobDataHandle> blobDataHandle() const;
+    void setBlobDataHandle(PassRefPtr<BlobDataHandle>);
+    PassRefPtr<BlobDataHandle> blobDataHandle() const;
 #endif
 
 private: