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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 int embedded_worker_id, | 45 int embedded_worker_id, |
46 int64 service_worker_version_id, | 46 int64 service_worker_version_id, |
47 const GURL& script_url); | 47 const GURL& script_url); |
48 bool StopWorker(int process_id, | 48 bool StopWorker(int process_id, |
49 int embedded_worker_id); | 49 int embedded_worker_id); |
50 | 50 |
51 // Called back from EmbeddedWorker in the child process, relayed via | 51 // Called back from EmbeddedWorker in the child process, relayed via |
52 // ServiceWorkerDispatcherHost. | 52 // ServiceWorkerDispatcherHost. |
53 void OnWorkerStarted(int process_id, int thread_id, int embedded_worker_id); | 53 void OnWorkerStarted(int process_id, int thread_id, int embedded_worker_id); |
54 void OnWorkerStopped(int process_id, int embedded_worker_id); | 54 void OnWorkerStopped(int process_id, int embedded_worker_id); |
| 55 void OnSendMessageToBrowser(int embedded_worker_id, |
| 56 const IPC::Message& message); |
55 | 57 |
56 // Keeps a map from process_id to sender information. | 58 // Keeps a map from process_id to sender information. |
57 void AddChildProcessSender(int process_id, IPC::Sender* sender); | 59 void AddChildProcessSender(int process_id, IPC::Sender* sender); |
58 void RemoveChildProcessSender(int process_id); | 60 void RemoveChildProcessSender(int process_id); |
59 | 61 |
60 private: | 62 private: |
61 friend class base::RefCounted<EmbeddedWorkerRegistry>; | 63 friend class base::RefCounted<EmbeddedWorkerRegistry>; |
62 friend class EmbeddedWorkerInstance; | 64 friend class EmbeddedWorkerInstance; |
63 | 65 |
64 typedef std::map<int, EmbeddedWorkerInstance*> WorkerInstanceMap; | 66 typedef std::map<int, EmbeddedWorkerInstance*> WorkerInstanceMap; |
(...skipping 16 matching lines...) Expand all Loading... |
81 std::map<int, int> worker_process_map_; | 83 std::map<int, int> worker_process_map_; |
82 | 84 |
83 int next_embedded_worker_id_; | 85 int next_embedded_worker_id_; |
84 | 86 |
85 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); | 87 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); |
86 }; | 88 }; |
87 | 89 |
88 } // namespace content | 90 } // namespace content |
89 | 91 |
90 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ | 92 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
OLD | NEW |