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_SERVICE_WORKER_VERSION_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 // calls |callback| when it errors out or it gets response from the worker | 116 // calls |callback| when it errors out or it gets response from the worker |
117 // to notify install completion. | 117 // to notify install completion. |
118 // |active_version_embedded_worker_id| must be a valid positive ID | 118 // |active_version_embedded_worker_id| must be a valid positive ID |
119 // if there's an active (previous) version running. | 119 // if there's an active (previous) version running. |
120 void DispatchInstallEvent(int active_version_embedded_worker_id, | 120 void DispatchInstallEvent(int active_version_embedded_worker_id, |
121 const StatusCallback& callback); | 121 const StatusCallback& callback); |
122 | 122 |
123 // Sends fetch event to the associated embedded worker. | 123 // Sends fetch event to the associated embedded worker. |
124 // This immediately returns false if the worker is not running | 124 // This immediately returns false if the worker is not running |
125 // or sending a message to the child process fails. | 125 // or sending a message to the child process fails. |
126 // TODO(kinuko): Make this take callback as well. | 126 // TODO(kinuko): Make this take callback as well. |
nhiroki
2014/02/14 09:03:21
Can you remove this TODO comment?
falken
2014/02/19 05:32:19
Done.
| |
127 bool DispatchFetchEvent(const ServiceWorkerFetchRequest& request); | 127 void DispatchFetchEvent(const ServiceWorkerFetchRequest& request, |
128 const StatusCallback& callback); | |
128 | 129 |
129 // These are expected to be called when a renderer process host for the | 130 // These are expected to be called when a renderer process host for the |
130 // same-origin as for this ServiceWorkerVersion is created. The added | 131 // same-origin as for this ServiceWorkerVersion is created. The added |
131 // processes are used to run an in-renderer embedded worker. | 132 // processes are used to run an in-renderer embedded worker. |
132 void AddProcessToWorker(int process_id); | 133 void AddProcessToWorker(int process_id); |
133 void RemoveProcessToWorker(int process_id); | 134 void RemoveProcessToWorker(int process_id); |
134 | 135 |
135 EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); } | 136 EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); } |
136 | 137 |
137 // EmbeddedWorkerInstance::Observer overrides: | 138 // EmbeddedWorkerInstance::Observer overrides: |
(...skipping 21 matching lines...) Expand all Loading... | |
159 IDMap<MessageCallback, IDMapOwnPointer> message_callbacks_; | 160 IDMap<MessageCallback, IDMapOwnPointer> message_callbacks_; |
160 | 161 |
161 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 162 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
162 | 163 |
163 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 164 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
164 }; | 165 }; |
165 | 166 |
166 } // namespace content | 167 } // namespace content |
167 | 168 |
168 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 169 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |