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

Unified Diff: content/common/service_worker/service_worker_types.h

Issue 178343011: Support dispatching ServiceWorker FetchEvent and receiving response (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: plubming Created 6 years, 10 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
Index: content/common/service_worker/service_worker_types.h
diff --git a/content/common/service_worker/service_worker_types.h b/content/common/service_worker/service_worker_types.h
index 10444de002ec58e0ee9ff1136c6aeb1343c6c309..6c7bb6e063a7038732edd5fa4caab4791894c2de 100644
--- a/content/common/service_worker/service_worker_types.h
+++ b/content/common/service_worker/service_worker_types.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "content/common/content_export.h"
+#include "third_party/WebKit/public/web/WebServiceWorkerResponse.h"
#include "url/gurl.h"
// This file is to have common definitions that are to be shared by
@@ -38,15 +39,19 @@ struct CONTENT_EXPORT ServiceWorkerFetchRequest {
std::map<std::string, std::string> headers;
};
-// The response sent from the child process to the browser.
-struct CONTENT_EXPORT ServiceWorkerFetchResponse {
- ServiceWorkerFetchResponse();
- ServiceWorkerFetchResponse(
- int status_code,
- const std::string& status_text,
- const std::string& method,
- const std::map<std::string, std::string>& headers);
- ~ServiceWorkerFetchResponse();
+// Indicates how the service worker handled a fetch event.
+enum ServiceWorkerFetchEventResult {
+ // Browser should fallback to native fetch.
+ FALLBACK,
+ // Service worker provided a ServiceWorkerResponse.
+ RESPONSE
kinuko 2014/03/04 06:39:17 We're in a relatively big namespace, content, it'd
falken 2014/03/05 03:35:41 Done.
+};
+
+// Represents a response to a fetch.
+struct CONTENT_EXPORT ServiceWorkerResponse {
+ ServiceWorkerResponse();
+ ServiceWorkerResponse(const blink::WebServiceWorkerResponse& response);
+ ~ServiceWorkerResponse();
int status_code;
std::string status_text;

Powered by Google App Engine
This is Rietveld 408576698