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

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: more review comments 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..b786d85c50f2b04273a684489371abea5ebcdd52 100644
--- a/content/common/service_worker/service_worker_types.h
+++ b/content/common/service_worker/service_worker_types.h
@@ -15,6 +15,10 @@
// This file is to have common definitions that are to be shared by
// browser and child process.
+namespace blink {
+class WebServiceWorkerResponse;
+}
+
namespace content {
// Indicates invalid request ID (i.e. the sender does not expect it gets
@@ -38,15 +42,20 @@ 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_RESULT_FALLBACK,
Tom Sepez 2014/03/05 21:07:01 nit: The string "Event" appears in the type name,
falken 2014/03/06 15:58:54 Agreed, especially since we want to distinguish be
+ // Service worker provided a ServiceWorkerResponse.
+ SERVICE_WORKER_FETCH_RESULT_RESPONSE
+};
Tom Sepez 2014/03/05 19:45:02 add SERVICE_WORKER_FETCH_EVENT_RESULT_LAST = SERVI
falken 2014/03/06 15:58:54 Done.
+
+// Represents a response to a fetch.
+struct CONTENT_EXPORT ServiceWorkerResponse {
+ ServiceWorkerResponse();
+ explicit ServiceWorkerResponse(
+ const blink::WebServiceWorkerResponse& response);
+ ~ServiceWorkerResponse();
int status_code;
std::string status_text;

Powered by Google App Engine
This is Rietveld 408576698