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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 const net::HttpResponseInfo* GetMainScriptHttpResponseInfo(); | 297 const net::HttpResponseInfo* GetMainScriptHttpResponseInfo(); |
298 | 298 |
299 private: | 299 private: |
300 friend class base::RefCounted<ServiceWorkerVersion>; | 300 friend class base::RefCounted<ServiceWorkerVersion>; |
301 friend class ServiceWorkerURLRequestJobTest; | 301 friend class ServiceWorkerURLRequestJobTest; |
302 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, | 302 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, |
303 ActivateWaitingVersion); | 303 ActivateWaitingVersion); |
304 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ScheduleStopWorker); | 304 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ScheduleStopWorker); |
305 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, KeepAlive); | 305 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, KeepAlive); |
306 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ListenerAvailability); | 306 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, ListenerAvailability); |
| 307 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionTest, SetDevToolsAttached); |
307 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerFailToStartTest, Timeout); | 308 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerFailToStartTest, Timeout); |
308 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionBrowserTest, | 309 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionBrowserTest, |
309 TimeoutStartingWorker); | 310 TimeoutStartingWorker); |
310 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionBrowserTest, | 311 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerVersionBrowserTest, |
311 TimeoutWorkerInEvent); | 312 TimeoutWorkerInEvent); |
312 friend class ServiceWorkerVersionBrowserTest; | 313 friend class ServiceWorkerVersionBrowserTest; |
313 | 314 |
314 typedef ServiceWorkerVersion self; | 315 typedef ServiceWorkerVersion self; |
315 typedef std::map<ServiceWorkerProviderHost*, int> ControlleeMap; | 316 typedef std::map<ServiceWorkerProviderHost*, int> ControlleeMap; |
316 typedef IDMap<ServiceWorkerProviderHost> ControlleeByIDMap; | 317 typedef IDMap<ServiceWorkerProviderHost> ControlleeByIDMap; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 base::RepeatingTimer<ServiceWorkerVersion> timeout_timer_; | 462 base::RepeatingTimer<ServiceWorkerVersion> timeout_timer_; |
462 // Holds the time the worker last started being considered idle. | 463 // Holds the time the worker last started being considered idle. |
463 base::TimeTicks idle_time_; | 464 base::TimeTicks idle_time_; |
464 // Holds the time that an outstanding ping was sent to the worker. | 465 // Holds the time that an outstanding ping was sent to the worker. |
465 base::TimeTicks ping_time_; | 466 base::TimeTicks ping_time_; |
466 // The state of the ping protocol. | 467 // The state of the ping protocol. |
467 PingState ping_state_; | 468 PingState ping_state_; |
468 // Holds the time that the outstanding StartWorker() request started. | 469 // Holds the time that the outstanding StartWorker() request started. |
469 base::TimeTicks start_time_; | 470 base::TimeTicks start_time_; |
470 | 471 |
471 bool is_doomed_; | 472 bool is_doomed_ = false; |
| 473 bool skip_waiting_ = false; |
| 474 bool skip_recording_startup_time_ = false; |
| 475 |
472 std::vector<int> pending_skip_waiting_requests_; | 476 std::vector<int> pending_skip_waiting_requests_; |
473 bool skip_waiting_; | |
474 scoped_ptr<net::HttpResponseInfo> main_script_http_info_; | 477 scoped_ptr<net::HttpResponseInfo> main_script_http_info_; |
475 | 478 |
476 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; | 479 base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_; |
477 | 480 |
478 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); | 481 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerVersion); |
479 }; | 482 }; |
480 | 483 |
481 } // namespace content | 484 } // namespace content |
482 | 485 |
483 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 486 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |