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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 ServiceWorkerScriptCacheMap* script_cache_map() { return &script_cache_map_; } | 282 ServiceWorkerScriptCacheMap* script_cache_map() { return &script_cache_map_; } |
283 EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); } | 283 EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); } |
284 | 284 |
285 // Dooms this version to have REDUNDANT status and its resources deleted. If | 285 // Dooms this version to have REDUNDANT status and its resources deleted. If |
286 // the version is controlling a page, these changes will happen when the | 286 // the version is controlling a page, these changes will happen when the |
287 // version no longer controls any pages. | 287 // version no longer controls any pages. |
288 void Doom(); | 288 void Doom(); |
289 bool is_doomed() const { return is_doomed_; } | 289 bool is_doomed() const { return is_doomed_; } |
290 | 290 |
291 bool skip_waiting() const { return skip_waiting_; } | 291 bool skip_waiting() const { return skip_waiting_; } |
292 bool claiming_clients() const { return claiming_clients_; } | |
falken
2015/01/29 15:10:37
I'd prefer is_claiming_clients(), otherwise it loo
michaeln
2015/01/29 22:35:34
I think this isn't needed, see comments in the pro
| |
292 | 293 |
293 void SetDevToolsAttached(bool attached); | 294 void SetDevToolsAttached(bool attached); |
294 | 295 |
295 private: | 296 private: |
296 class GetClientDocumentsCallback; | 297 class GetClientDocumentsCallback; |
297 | 298 |
298 friend class base::RefCounted<ServiceWorkerVersion>; | 299 friend class base::RefCounted<ServiceWorkerVersion>; |
299 friend class ServiceWorkerURLRequestJobTest; | 300 friend class ServiceWorkerURLRequestJobTest; |
300 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, | 301 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, |
301 ActivateWaitingVersion); | 302 ActivateWaitingVersion); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
350 void OnPushEventFinished(int request_id, | 351 void OnPushEventFinished(int request_id, |
351 blink::WebServiceWorkerEventResult result); | 352 blink::WebServiceWorkerEventResult result); |
352 void OnGeofencingEventFinished(int request_id); | 353 void OnGeofencingEventFinished(int request_id); |
353 void OnCrossOriginConnectEventFinished(int request_id, | 354 void OnCrossOriginConnectEventFinished(int request_id, |
354 bool accept_connection); | 355 bool accept_connection); |
355 void OnPostMessageToDocument(int client_id, | 356 void OnPostMessageToDocument(int client_id, |
356 const base::string16& message, | 357 const base::string16& message, |
357 const std::vector<int>& sent_message_port_ids); | 358 const std::vector<int>& sent_message_port_ids); |
358 void OnFocusClient(int request_id, int client_id); | 359 void OnFocusClient(int request_id, int client_id); |
359 void OnSkipWaiting(int request_id); | 360 void OnSkipWaiting(int request_id); |
361 void OnClaimClients(int request_id); | |
360 | 362 |
361 void OnFocusClientFinished(int request_id, bool result); | 363 void OnFocusClientFinished(int request_id, bool result); |
362 void DidSkipWaiting(int request_id); | 364 void DidSkipWaiting(int request_id); |
363 void DidGetClientInfo(int client_id, | 365 void DidGetClientInfo(int client_id, |
364 scoped_refptr<GetClientDocumentsCallback> callback, | 366 scoped_refptr<GetClientDocumentsCallback> callback, |
365 ServiceWorkerStatusCode status, | 367 ServiceWorkerStatusCode status, |
366 const ServiceWorkerClientInfo& info); | 368 const ServiceWorkerClientInfo& info); |
367 void ScheduleStopWorker(); | 369 void ScheduleStopWorker(); |
368 void StopWorkerIfIdle(); | 370 void StopWorkerIfIdle(); |
369 bool HasInflightRequests() const; | 371 bool HasInflightRequests() const; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 ControlleeMap controllee_map_; | 404 ControlleeMap controllee_map_; |
403 ControlleeByIDMap controllee_by_id_; | 405 ControlleeByIDMap controllee_by_id_; |
404 base::WeakPtr<ServiceWorkerContextCore> context_; | 406 base::WeakPtr<ServiceWorkerContextCore> context_; |
405 ObserverList<Listener> listeners_; | 407 ObserverList<Listener> listeners_; |
406 ServiceWorkerScriptCacheMap script_cache_map_; | 408 ServiceWorkerScriptCacheMap script_cache_map_; |
407 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; | 409 base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_; |
408 base::OneShotTimer<ServiceWorkerVersion> update_timer_; | 410 base::OneShotTimer<ServiceWorkerVersion> update_timer_; |
409 bool is_doomed_; | 411 bool is_doomed_; |
410 std::vector<int> pending_skip_waiting_requests_; | 412 std::vector<int> pending_skip_waiting_requests_; |
411 bool skip_waiting_; | 413 bool skip_waiting_; |
414 bool claiming_clients_; | |
412 | 415 |
413 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 416 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
414 | 417 |
415 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 418 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
416 }; | 419 }; |
417 | 420 |
418 } // namespace content | 421 } // namespace content |
419 | 422 |
420 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 423 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |