| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
| 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // potential EW/SW layering concerns. | 30 // potential EW/SW layering concerns. |
| 31 class ServiceWorkerScriptContext { | 31 class ServiceWorkerScriptContext { |
| 32 public: | 32 public: |
| 33 ServiceWorkerScriptContext( | 33 ServiceWorkerScriptContext( |
| 34 EmbeddedWorkerContextClient* embedded_context, | 34 EmbeddedWorkerContextClient* embedded_context, |
| 35 blink::WebServiceWorkerContextProxy* proxy); | 35 blink::WebServiceWorkerContextProxy* proxy); |
| 36 ~ServiceWorkerScriptContext(); | 36 ~ServiceWorkerScriptContext(); |
| 37 | 37 |
| 38 void OnMessageReceived(int request_id, const IPC::Message& message); | 38 void OnMessageReceived(int request_id, const IPC::Message& message); |
| 39 | 39 |
| 40 void DidHandleInstallEvent(int request_id); | 40 void DidHandleInstallEvent(int request_id, ServiceWorkerInstallEventResult); |
| 41 void DidHandleFetchEvent(int request_id, | 41 void DidHandleFetchEvent(int request_id, |
| 42 ServiceWorkerFetchEventResult result, | 42 ServiceWorkerFetchEventResult result, |
| 43 const ServiceWorkerResponse& response); | 43 const ServiceWorkerResponse& response); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 // Send message back to the browser. | 46 // Send message back to the browser. |
| 47 void Send(int request_id, const IPC::Message& message); | 47 void Send(int request_id, const IPC::Message& message); |
| 48 | 48 |
| 49 void OnInstallEvent(int active_version_embedded_worker_id); | 49 void OnInstallEvent(int active_version_embedded_worker_id); |
| 50 void OnFetchEvent(const ServiceWorkerFetchRequest& request); | 50 void OnFetchEvent(const ServiceWorkerFetchRequest& request); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 62 // back to the browser is expected, the id must be sent back with the | 62 // back to the browser is expected, the id must be sent back with the |
| 63 // response. | 63 // response. |
| 64 int current_request_id_; | 64 int current_request_id_; |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); | 66 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace content | 69 } // namespace content |
| 70 | 70 |
| 71 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 71 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
| OLD | NEW |