OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_NAVIGATION_HANDLE_CORE_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_NAVIGATION_HANDLE_CORE_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_NAVIGATION_HANDLE_CORE_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_NAVIGATION_HANDLE_CORE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "content/common/content_export.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 class ServiceWorkerContextWrapper; | 17 class ServiceWorkerContextWrapper; |
17 class ServiceWorkerNavigationHandle; | 18 class ServiceWorkerNavigationHandle; |
18 class ServiceWorkerProviderHost; | 19 class ServiceWorkerProviderHost; |
19 | 20 |
20 // PlzNavigate | 21 // PlzNavigate |
21 // This class is used to manage the lifetime of ServiceWorkerProviderHosts | 22 // This class is used to manage the lifetime of ServiceWorkerProviderHosts |
22 // created during navigations. This class is created on the UI thread, but | 23 // created during navigations. This class is created on the UI thread, but |
23 // should only be accessed from the IO thread afterwards. It is the IO thread | 24 // should only be accessed from the IO thread afterwards. It is the IO thread |
24 // pendant of ServiceWorkerNavigationHandle. See the | 25 // pendant of ServiceWorkerNavigationHandle. See the |
25 // ServiceWorkerNavigationHandle header for more details about the lifetime of | 26 // ServiceWorkerNavigationHandle header for more details about the lifetime of |
26 // both classes. | 27 // both classes. |
27 class ServiceWorkerNavigationHandleCore { | 28 class CONTENT_EXPORT ServiceWorkerNavigationHandleCore { |
28 public: | 29 public: |
29 ServiceWorkerNavigationHandleCore( | 30 ServiceWorkerNavigationHandleCore( |
30 base::WeakPtr<ServiceWorkerNavigationHandle> ui_handle, | 31 base::WeakPtr<ServiceWorkerNavigationHandle> ui_handle, |
31 ServiceWorkerContextWrapper* context_wrapper); | 32 ServiceWorkerContextWrapper* context_wrapper); |
32 ~ServiceWorkerNavigationHandleCore(); | 33 ~ServiceWorkerNavigationHandleCore(); |
33 | 34 |
34 // Called when a ServiceWorkerProviderHost was pre-created for the navigation | 35 // Called when a ServiceWorkerProviderHost was pre-created for the navigation |
35 // tracked by this ServiceWorkerNavigationHandleCore. Takes ownership of | 36 // tracked by this ServiceWorkerNavigationHandleCore. Takes ownership of |
36 // |precreated_host|. | 37 // |precreated_host|. |
37 void DidPreCreateProviderHost( | 38 void DidPreCreateProviderHost( |
(...skipping 11 matching lines...) Expand all Loading... |
49 std::unique_ptr<ServiceWorkerProviderHost> precreated_host_; | 50 std::unique_ptr<ServiceWorkerProviderHost> precreated_host_; |
50 scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; | 51 scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; |
51 base::WeakPtr<ServiceWorkerNavigationHandle> ui_handle_; | 52 base::WeakPtr<ServiceWorkerNavigationHandle> ui_handle_; |
52 | 53 |
53 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerNavigationHandleCore); | 54 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerNavigationHandleCore); |
54 }; | 55 }; |
55 | 56 |
56 } // namespace content | 57 } // namespace content |
57 | 58 |
58 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_NAVIGATION_HANDLE_CORE_
H_ | 59 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_NAVIGATION_HANDLE_CORE_
H_ |
OLD | NEW |