OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 int64 service_worker_version_id, | 47 int64 service_worker_version_id, |
48 const GURL& script_url); | 48 const GURL& script_url); |
49 ServiceWorkerStatusCode StopWorker(int process_id, | 49 ServiceWorkerStatusCode StopWorker(int process_id, |
50 int embedded_worker_id); | 50 int embedded_worker_id); |
51 | 51 |
52 // Called back from EmbeddedWorker in the child process, relayed via | 52 // Called back from EmbeddedWorker in the child process, relayed via |
53 // ServiceWorkerDispatcherHost. | 53 // ServiceWorkerDispatcherHost. |
54 void OnWorkerStarted(int process_id, int thread_id, int embedded_worker_id); | 54 void OnWorkerStarted(int process_id, int thread_id, int embedded_worker_id); |
55 void OnWorkerStopped(int process_id, int embedded_worker_id); | 55 void OnWorkerStopped(int process_id, int embedded_worker_id); |
56 void OnSendMessageToBrowser(int embedded_worker_id, | 56 void OnSendMessageToBrowser(int embedded_worker_id, |
| 57 int request_id, |
57 const IPC::Message& message); | 58 const IPC::Message& message); |
58 | 59 |
59 // Keeps a map from process_id to sender information. | 60 // Keeps a map from process_id to sender information. |
60 void AddChildProcessSender(int process_id, IPC::Sender* sender); | 61 void AddChildProcessSender(int process_id, IPC::Sender* sender); |
61 void RemoveChildProcessSender(int process_id); | 62 void RemoveChildProcessSender(int process_id); |
62 | 63 |
63 // Returns an embedded worker instance for given |embedded_worker_id|. | 64 // Returns an embedded worker instance for given |embedded_worker_id|. |
64 EmbeddedWorkerInstance* GetWorker(int embedded_worker_id); | 65 EmbeddedWorkerInstance* GetWorker(int embedded_worker_id); |
65 | 66 |
66 private: | 67 private: |
(...skipping 20 matching lines...) Expand all Loading... |
87 std::map<int, int> worker_process_map_; | 88 std::map<int, int> worker_process_map_; |
88 | 89 |
89 int next_embedded_worker_id_; | 90 int next_embedded_worker_id_; |
90 | 91 |
91 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); | 92 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); |
92 }; | 93 }; |
93 | 94 |
94 } // namespace content | 95 } // namespace content |
95 | 96 |
96 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ | 97 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
OLD | NEW |