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

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: use const for result on failure Created 6 years, 9 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 9eccc7b6c5e1eb3095df6e664c9093092af6071f..b5e8247d6f505f92c62dd7586591acc4bb7e253a 100644
--- a/content/common/service_worker/service_worker_types.h
+++ b/content/common/service_worker/service_worker_types.h
@@ -40,15 +40,23 @@ 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.
+ SERVICE_WORKER_FETCH_EVENT_RESULT_FALLBACK,
+ // Service worker provided a ServiceWorkerResponse.
+ SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE,
+ SERVICE_WORKER_FETCH_EVENT_LAST = SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE
+};
+
+// Represents a response to a fetch.
+struct CONTENT_EXPORT ServiceWorkerResponse {
+ ServiceWorkerResponse();
+ ServiceWorkerResponse(int status_code,
+ const std::string& status_text,
+ const std::string& method,
+ const std::map<std::string, std::string>& headers);
+ ~ServiceWorkerResponse();
int status_code;
std::string status_text;
« no previous file with comments | « content/common/service_worker/service_worker_messages.h ('k') | content/common/service_worker/service_worker_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698