Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: public/platform/WebServiceWorkerRequest.h

Issue 304053003: ServiceWorker: support Request.{url,method,origin,headers} [blink] (1/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/ServiceWorkerGlobalScopeProxy.cpp ('k') | public/web/WebServiceWorkerContextProxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebServiceWorkerRequest.h
diff --git a/public/platform/WebServiceWorkerResponse.h b/public/platform/WebServiceWorkerRequest.h
similarity index 36%
copy from public/platform/WebServiceWorkerResponse.h
copy to public/platform/WebServiceWorkerRequest.h
index 9e5a25c39550a4e09af6ce133c15559e9981748b..547572619f865b0106f988858b99164f6d040301 100644
--- a/public/platform/WebServiceWorkerResponse.h
+++ b/public/platform/WebServiceWorkerRequest.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef WebServiceWorkerResponse_h
-#define WebServiceWorkerResponse_h
+#ifndef WebServiceWorkerRequest_h
+#define WebServiceWorkerRequest_h
#include "WebCommon.h"
#include "public/platform/WebPrivatePtr.h"
#include "public/platform/WebString.h"
-#include "public/platform/WebVector.h"
+#include "public/platform/WebURL.h"
#if INSIDE_BLINK
#include "wtf/Forward.h"
@@ -16,50 +16,42 @@
#include "wtf/text/StringHash.h"
#endif
-// FIXME: Remove this after chromium code is cleaned up.
-#define NEW_SERVICE_WORKER_RESPONSE_INTERFACE
-
namespace blink {
-class WebServiceWorkerResponsePrivate;
+class WebServiceWorkerRequestPrivate;
-// Represents a response to a fetch operation. ServiceWorker uses this to
-// respond to a FetchEvent dispatched by the browser. The plan is for the Cache
-// and fetch() API to also use it.
-class BLINK_PLATFORM_EXPORT WebServiceWorkerResponse {
+// Represents a request of a fetch operation. FetchEvent dispatched by the
+// browser contains this. The plan is for the Cache and fetch() API to also use
+// it.
+class BLINK_PLATFORM_EXPORT WebServiceWorkerRequest {
public:
- ~WebServiceWorkerResponse() { reset(); }
- WebServiceWorkerResponse();
- WebServiceWorkerResponse& operator=(const WebServiceWorkerResponse& other)
+ ~WebServiceWorkerRequest() { reset(); }
+ WebServiceWorkerRequest();
+ WebServiceWorkerRequest& operator=(const WebServiceWorkerRequest& other)
{
assign(other);
return *this;
}
void reset();
- void assign(const WebServiceWorkerResponse&);
+ void assign(const WebServiceWorkerRequest&);
- void setStatus(unsigned short);
- unsigned short status() const;
+ void setURL(const WebURL&);
+ WebURL url() const;
- void setStatusText(const WebString&);
- WebString statusText() const;
+ void setMethod(const WebString&);
+ WebString method() const;
void setHeader(const WebString& key, const WebString& value);
- WebVector<WebString> getHeaderKeys() const;
- WebString getHeader(const WebString& key) const;
#if INSIDE_BLINK
- void setHeaders(const HashMap<String, String>&);
const HashMap<String, String>& headers() const;
#endif
- // FIXME: Eventually this should have additional methods such as for blob.
-
private:
- WebPrivatePtr<WebServiceWorkerResponsePrivate> m_private;
+ WebPrivatePtr<WebServiceWorkerRequestPrivate> m_private;
};
} // namespace blink
-#endif // WebServiceWorkerResponse_h
+#endif // WebServiceWorkerRequest_h
« no previous file with comments | « Source/web/ServiceWorkerGlobalScopeProxy.cpp ('k') | public/web/WebServiceWorkerContextProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698