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> |
| 9 |
8 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/strings/string16.h" |
9 | 12 |
10 namespace blink { | 13 namespace blink { |
11 class WebServiceWorkerContextProxy; | 14 class WebServiceWorkerContextProxy; |
12 } | 15 } |
13 | 16 |
14 namespace IPC { | 17 namespace IPC { |
15 class Message; | 18 class Message; |
16 } | 19 } |
17 | 20 |
18 namespace content { | 21 namespace content { |
(...skipping 18 matching lines...) Expand all Loading... |
37 void DidHandleInstallEvent(int request_id); | 40 void DidHandleInstallEvent(int request_id); |
38 void DidHandleFetchEvent(int request_id, | 41 void DidHandleFetchEvent(int request_id, |
39 const ServiceWorkerFetchResponse& response); | 42 const ServiceWorkerFetchResponse& response); |
40 | 43 |
41 private: | 44 private: |
42 // Send message back to the browser. | 45 // Send message back to the browser. |
43 void Send(int request_id, const IPC::Message& message); | 46 void Send(int request_id, const IPC::Message& message); |
44 | 47 |
45 void OnInstallEvent(int active_version_embedded_worker_id); | 48 void OnInstallEvent(int active_version_embedded_worker_id); |
46 void OnFetchEvent(const ServiceWorkerFetchRequest& request); | 49 void OnFetchEvent(const ServiceWorkerFetchRequest& request); |
| 50 void OnMessage(base::string16 message, |
| 51 std::vector<int> sent_message_port_ids, |
| 52 std::vector<int> new_routing_ids); |
47 | 53 |
48 // Not owned; embedded_context_ owns this. | 54 // Not owned; embedded_context_ owns this. |
49 EmbeddedWorkerContextClient* embedded_context_; | 55 EmbeddedWorkerContextClient* embedded_context_; |
50 | 56 |
51 // Not owned; this object is destroyed when proxy_ becomes invalid. | 57 // Not owned; this object is destroyed when proxy_ becomes invalid. |
52 blink::WebServiceWorkerContextProxy* proxy_; | 58 blink::WebServiceWorkerContextProxy* proxy_; |
53 | 59 |
54 // Used by message handlers. | 60 // Used by message handlers. |
55 int current_request_id_; | 61 int current_request_id_; |
56 | 62 |
57 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); | 63 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); |
58 }; | 64 }; |
59 | 65 |
60 } // namespace content | 66 } // namespace content |
61 | 67 |
62 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ | 68 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ |
OLD | NEW |