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 #include <vector> | 10 #include <vector> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 static scoped_refptr<EmbeddedWorkerRegistry> Create( | 44 static scoped_refptr<EmbeddedWorkerRegistry> Create( |
45 const base::WeakPtr<ServiceWorkerContextCore>& contxet); | 45 const base::WeakPtr<ServiceWorkerContextCore>& contxet); |
46 | 46 |
47 // Used for DeleteAndStartOver. Creates a new registry which takes over | 47 // Used for DeleteAndStartOver. Creates a new registry which takes over |
48 // |next_embedded_worker_id_| and |process_sender_map_| from |old_registry|. | 48 // |next_embedded_worker_id_| and |process_sender_map_| from |old_registry|. |
49 static scoped_refptr<EmbeddedWorkerRegistry> Create( | 49 static scoped_refptr<EmbeddedWorkerRegistry> Create( |
50 const base::WeakPtr<ServiceWorkerContextCore>& context, | 50 const base::WeakPtr<ServiceWorkerContextCore>& context, |
51 EmbeddedWorkerRegistry* old_registry); | 51 EmbeddedWorkerRegistry* old_registry); |
52 | 52 |
53 bool OnMessageReceived(const IPC::Message& message); | 53 bool OnMessageReceived(const IPC::Message& message, int process_id); |
54 | 54 |
55 // Creates and removes a new worker instance entry for bookkeeping. | 55 // Creates and removes a new worker instance entry for bookkeeping. |
56 // This doesn't actually start or stop the worker. | 56 // This doesn't actually start or stop the worker. |
57 scoped_ptr<EmbeddedWorkerInstance> CreateWorker(); | 57 scoped_ptr<EmbeddedWorkerInstance> CreateWorker(); |
58 | 58 |
59 // Called from EmbeddedWorkerInstance, relayed to the child process. | 59 // Called from EmbeddedWorkerInstance, relayed to the child process. |
60 ServiceWorkerStatusCode SendStartWorker( | 60 ServiceWorkerStatusCode SendStartWorker( |
61 scoped_ptr<EmbeddedWorkerMsg_StartWorker_Params> params, | 61 scoped_ptr<EmbeddedWorkerMsg_StartWorker_Params> params, |
62 int process_id); | 62 int process_id); |
63 ServiceWorkerStatusCode StopWorker(int process_id, | 63 ServiceWorkerStatusCode StopWorker(int process_id, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 int next_embedded_worker_id_; | 139 int next_embedded_worker_id_; |
140 const int initial_embedded_worker_id_; | 140 const int initial_embedded_worker_id_; |
141 | 141 |
142 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); | 142 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerRegistry); |
143 }; | 143 }; |
144 | 144 |
145 } // namespace content | 145 } // namespace content |
146 | 146 |
147 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ | 147 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_REGISTRY_H_ |
OLD | NEW |