| 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 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 int embedded_worker_id, | 47 int embedded_worker_id, |
| 48 int64 service_worker_version_id, | 48 int64 service_worker_version_id, |
| 49 const GURL& script_url); | 49 const GURL& script_url); |
| 50 ServiceWorkerStatusCode StopWorker(int process_id, | 50 ServiceWorkerStatusCode StopWorker(int process_id, |
| 51 int embedded_worker_id); | 51 int embedded_worker_id); |
| 52 | 52 |
| 53 // Called back from EmbeddedWorker in the child process, relayed via | 53 // Called back from EmbeddedWorker in the child process, relayed via |
| 54 // ServiceWorkerDispatcherHost. | 54 // ServiceWorkerDispatcherHost. |
| 55 void OnWorkerStarted(int process_id, int thread_id, int embedded_worker_id); | 55 void OnWorkerStarted(int process_id, int thread_id, int embedded_worker_id); |
| 56 void OnWorkerStopped(int process_id, int embedded_worker_id); | 56 void OnWorkerStopped(int process_id, int embedded_worker_id); |
| 57 // FIXME(dominicc): Rename this. The name leads to confusion that |
| 58 // this sends a message to the browser itself. |
| 57 void OnSendMessageToBrowser(int embedded_worker_id, | 59 void OnSendMessageToBrowser(int embedded_worker_id, |
| 58 int request_id, | 60 int request_id, |
| 59 const IPC::Message& message); | 61 const IPC::Message& message); |
| 60 | 62 |
| 61 // Keeps a map from process_id to sender information. | 63 // Keeps a map from process_id to sender information. |
| 62 void AddChildProcessSender(int process_id, IPC::Sender* sender); | 64 void AddChildProcessSender(int process_id, IPC::Sender* sender); |
| 63 void RemoveChildProcessSender(int process_id); | 65 void RemoveChildProcessSender(int process_id); |
| 64 | 66 |
| 65 // Returns an embedded worker instance for given |embedded_worker_id|. | 67 // Returns an embedded worker instance for given |embedded_worker_id|. |
| 66 EmbeddedWorkerInstance* GetWorker(int embedded_worker_id); | 68 EmbeddedWorkerInstance* GetWorker(int embedded_worker_id); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 89 std::map<int, std::set<int> > worker_process_map_; | 91 std::map<int, std::set<int> > worker_process_map_; |
| 90 | 92 |
| 91 int next_embedded_worker_id_; | 93 int next_embedded_worker_id_; |
| 92 | 94 |
| 93 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); | 95 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); |
| 94 }; | 96 }; |
| 95 | 97 |
| 96 } // namespace content | 98 } // namespace content |
| 97 | 99 |
| 98 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ | 100 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
| OLD | NEW |