| 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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROCESS_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROCESS_MANAGER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROCESS_MANAGER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROCESS_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // on the UI thread shortly after its ServiceWorkerContextWrapper is destroyed. | 27 // on the UI thread shortly after its ServiceWorkerContextWrapper is destroyed. |
| 28 class CONTENT_EXPORT ServiceWorkerProcessManager { | 28 class CONTENT_EXPORT ServiceWorkerProcessManager { |
| 29 public: | 29 public: |
| 30 // |*this| must be owned by a ServiceWorkerContextWrapper in a | 30 // |*this| must be owned by a ServiceWorkerContextWrapper in a |
| 31 // StoragePartition within |browser_context|. | 31 // StoragePartition within |browser_context|. |
| 32 explicit ServiceWorkerProcessManager(BrowserContext* browser_context); | 32 explicit ServiceWorkerProcessManager(BrowserContext* browser_context); |
| 33 | 33 |
| 34 // Shutdown must be called before the ProcessManager is destroyed. | 34 // Shutdown must be called before the ProcessManager is destroyed. |
| 35 ~ServiceWorkerProcessManager(); | 35 ~ServiceWorkerProcessManager(); |
| 36 | 36 |
| 37 // Synchronously prevents new processes from being allocated. | 37 // Synchronously prevents new processes from being allocated |
| 38 // TODO(jyasskin): Drop references to RenderProcessHosts too. | 38 // and drops references to RenderProcessHosts. |
| 39 void Shutdown(); | 39 void Shutdown(); |
| 40 | 40 |
| 41 // Returns a reference to a running process suitable for starting the Service | 41 // Returns a reference to a running process suitable for starting the Service |
| 42 // Worker at |script_url|. Posts |callback| to the IO thread to indicate | 42 // Worker at |script_url|. Posts |callback| to the IO thread to indicate |
| 43 // whether creation succeeded and the process ID that has a new reference. | 43 // whether creation succeeded and the process ID that has a new reference. |
| 44 // | 44 // |
| 45 // Allocation can fail with SERVICE_WORKER_ERROR_START_WORKER_FAILED if | 45 // Allocation can fail with SERVICE_WORKER_ERROR_START_WORKER_FAILED if |
| 46 // RenderProcessHost::Init fails. | 46 // RenderProcessHost::Init fails. |
| 47 void AllocateWorkerProcess( | 47 void AllocateWorkerProcess( |
| 48 int embedded_worker_id, | 48 int embedded_worker_id, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 namespace base { | 132 namespace base { |
| 133 // Specialized to post the deletion to the UI thread. | 133 // Specialized to post the deletion to the UI thread. |
| 134 template <> | 134 template <> |
| 135 struct CONTENT_EXPORT DefaultDeleter<content::ServiceWorkerProcessManager> { | 135 struct CONTENT_EXPORT DefaultDeleter<content::ServiceWorkerProcessManager> { |
| 136 void operator()(content::ServiceWorkerProcessManager* ptr) const; | 136 void operator()(content::ServiceWorkerProcessManager* ptr) const; |
| 137 }; | 137 }; |
| 138 } // namespace base | 138 } // namespace base |
| 139 | 139 |
| 140 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROCESS_MANAGER_H_ | 140 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROCESS_MANAGER_H_ |
| OLD | NEW |