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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <functional> | 10 #include <functional> |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 void SetMainScriptHttpResponseInfo(const net::HttpResponseInfo& http_info); | 362 void SetMainScriptHttpResponseInfo(const net::HttpResponseInfo& http_info); |
363 const net::HttpResponseInfo* GetMainScriptHttpResponseInfo(); | 363 const net::HttpResponseInfo* GetMainScriptHttpResponseInfo(); |
364 | 364 |
365 // Simulate ping timeout. Should be used for tests-only. | 365 // Simulate ping timeout. Should be used for tests-only. |
366 void SimulatePingTimeoutForTesting(); | 366 void SimulatePingTimeoutForTesting(); |
367 | 367 |
368 // Returns true if the service worker has work to do: it has pending | 368 // Returns true if the service worker has work to do: it has pending |
369 // requests, in-progress streaming URLRequestJobs, or pending start callbacks. | 369 // requests, in-progress streaming URLRequestJobs, or pending start callbacks. |
370 bool HasWork() const; | 370 bool HasWork() const; |
371 | 371 |
| 372 base::WeakPtr<ServiceWorkerVersion> GetWeakPtr() { |
| 373 return weak_factory_.GetWeakPtr(); |
| 374 } |
| 375 |
372 private: | 376 private: |
373 friend class base::RefCounted<ServiceWorkerVersion>; | 377 friend class base::RefCounted<ServiceWorkerVersion>; |
374 friend class ServiceWorkerMetrics; | 378 friend class ServiceWorkerMetrics; |
375 friend class ServiceWorkerReadFromCacheJobTest; | 379 friend class ServiceWorkerReadFromCacheJobTest; |
376 friend class ServiceWorkerStallInStoppingTest; | 380 friend class ServiceWorkerStallInStoppingTest; |
377 friend class ServiceWorkerURLRequestJobTest; | 381 friend class ServiceWorkerURLRequestJobTest; |
378 friend class ServiceWorkerVersionBrowserTest; | 382 friend class ServiceWorkerVersionBrowserTest; |
379 friend class ServiceWorkerVersionTest; | 383 friend class ServiceWorkerVersionTest; |
380 | 384 |
381 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, | 385 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 | 842 |
839 // At this point |this| can have been deleted, so don't do anything other | 843 // At this point |this| can have been deleted, so don't do anything other |
840 // than returning. | 844 // than returning. |
841 | 845 |
842 return true; | 846 return true; |
843 } | 847 } |
844 | 848 |
845 } // namespace content | 849 } // namespace content |
846 | 850 |
847 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 851 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
OLD | NEW |