Chromium Code Reviews| 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; |