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 25 matching lines...) Expand all Loading... |
36 blink::WebServiceWorkerContextProxy* proxy); | 36 blink::WebServiceWorkerContextProxy* proxy); |
37 ~ServiceWorkerScriptContext(); | 37 ~ServiceWorkerScriptContext(); |
38 | 38 |
39 void OnMessageReceived(int request_id, const IPC::Message& message); | 39 void OnMessageReceived(int request_id, const IPC::Message& message); |
40 | 40 |
41 void DidHandleInstallEvent(int request_id, | 41 void DidHandleInstallEvent(int request_id, |
42 blink::WebServiceWorkerEventResult result); | 42 blink::WebServiceWorkerEventResult result); |
43 void DidHandleFetchEvent(int request_id, | 43 void DidHandleFetchEvent(int request_id, |
44 ServiceWorkerFetchEventResult result, | 44 ServiceWorkerFetchEventResult result, |
45 const ServiceWorkerResponse& response); | 45 const ServiceWorkerResponse& response); |
| 46 void DidHandleSyncEvent(int request_id); |
46 | 47 |
47 private: | 48 private: |
48 // Send message back to the browser. | 49 // Send message back to the browser. |
49 void Send(int request_id, const IPC::Message& message); | 50 void Send(int request_id, const IPC::Message& message); |
50 | 51 |
51 void OnInstallEvent(int active_version_id); | 52 void OnInstallEvent(int active_version_id); |
52 void OnFetchEvent(const ServiceWorkerFetchRequest& request); | 53 void OnFetchEvent(const ServiceWorkerFetchRequest& request); |
53 void OnPostMessage(const base::string16& message, | 54 void OnPostMessage(const base::string16& message, |
54 const std::vector<int>& sent_message_port_ids, | 55 const std::vector<int>& sent_message_port_ids, |
55 const std::vector<int>& new_routing_ids); | 56 const std::vector<int>& new_routing_ids); |
| 57 void OnSyncEvent(); |
56 | 58 |
57 // Not owned; embedded_context_ owns this. | 59 // Not owned; embedded_context_ owns this. |
58 EmbeddedWorkerContextClient* embedded_context_; | 60 EmbeddedWorkerContextClient* embedded_context_; |
59 | 61 |
60 // Not owned; this object is destroyed when proxy_ becomes invalid. | 62 // Not owned; this object is destroyed when proxy_ becomes invalid. |
61 blink::WebServiceWorkerContextProxy* proxy_; | 63 blink::WebServiceWorkerContextProxy* proxy_; |
62 | 64 |
63 // Used for incoming messages from the browser for which an outgoing response | 65 // Used for incoming messages from the browser for which an outgoing response |
64 // back to the browser is expected, the id must be sent back with the | 66 // back to the browser is expected, the id must be sent back with the |
65 // response. | 67 // response. |
66 int current_request_id_; | 68 int current_request_id_; |
67 | 69 |
68 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); | 70 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); |
69 }; | 71 }; |
70 | 72 |
71 } // namespace content | 73 } // namespace content |
72 | 74 |
73 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 75 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
OLD | NEW |