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 24 matching lines...) Expand all Loading... |
35 ~ServiceWorkerProcessManager(); | 35 ~ServiceWorkerProcessManager(); |
36 | 36 |
37 // Synchronously prevents new processes from being allocated | 37 // Synchronously prevents new processes from being allocated |
38 // and drops references to RenderProcessHosts. | 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_PROCESS_NOT_FOUND 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, |
49 const GURL& pattern, | 49 const GURL& pattern, |
50 const GURL& script_url, | 50 const GURL& script_url, |
51 const base::Callback<void(ServiceWorkerStatusCode, int process_id)>& | 51 const base::Callback<void(ServiceWorkerStatusCode, int process_id)>& |
52 callback); | 52 callback); |
53 | 53 |
54 // Drops a reference to a process that was running a Service Worker, and its | 54 // Drops a reference to a process that was running a Service Worker, and its |
55 // SiteInstance. This must match a call to AllocateWorkerProcess. | 55 // SiteInstance. This must match a call to AllocateWorkerProcess. |
(...skipping 75 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 |