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