#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
public:
~WebServiceWorkerResponse() { reset(); }
WebServiceWorkerResponse();
+ WebServiceWorkerResponse(const WebServiceWorkerResponse& other) { assign(other); }
WebServiceWorkerResponse& operator=(const WebServiceWorkerResponse& other)
{
assign(other);
void reset();
void assign(const WebServiceWorkerResponse&);
+ void setURL(const WebURL&);
+ WebURL url() const;
+
void setStatus(unsigned short);
unsigned short status() const;
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: