OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FETCH_DISPATCHER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_FETCH_DISPATCHER_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_FETCH_DISPATCHER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_FETCH_DISPATCHER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 std::unique_ptr<ServiceWorkerFetchRequest> request, | 43 std::unique_ptr<ServiceWorkerFetchRequest> request, |
44 ServiceWorkerVersion* version, | 44 ServiceWorkerVersion* version, |
45 ResourceType resource_type, | 45 ResourceType resource_type, |
46 const base::Optional<base::TimeDelta>& timeout, | 46 const base::Optional<base::TimeDelta>& timeout, |
47 const net::NetLogWithSource& net_log, | 47 const net::NetLogWithSource& net_log, |
48 const base::Closure& prepare_callback, | 48 const base::Closure& prepare_callback, |
49 const FetchCallback& fetch_callback); | 49 const FetchCallback& fetch_callback); |
50 ~ServiceWorkerFetchDispatcher(); | 50 ~ServiceWorkerFetchDispatcher(); |
51 | 51 |
52 // If appropriate, starts the navigation preload request and creates | 52 // If appropriate, starts the navigation preload request and creates |
53 // |preload_handle_|. | 53 // |preload_handle_|. Returns true if it started navigation preload. |
54 void MaybeStartNavigationPreload(net::URLRequest* original_request); | 54 bool MaybeStartNavigationPreload(net::URLRequest* original_request); |
55 | 55 |
56 // Dispatches a fetch event to the |version| given in ctor, and fires | 56 // Dispatches a fetch event to the |version| given in ctor, and fires |
57 // |fetch_callback| (also given in ctor) when finishes. It runs | 57 // |fetch_callback| (also given in ctor) when finishes. It runs |
58 // |prepare_callback| as an intermediate step once the version is activated | 58 // |prepare_callback| as an intermediate step once the version is activated |
59 // and running. | 59 // and running. |
60 void Run(); | 60 void Run(); |
61 | 61 |
62 private: | 62 private: |
63 class ResponseCallback; | 63 class ResponseCallback; |
64 | 64 |
(...skipping 27 matching lines...) Expand all Loading... |
92 mojom::FetchEventPreloadHandlePtr preload_handle_; | 92 mojom::FetchEventPreloadHandlePtr preload_handle_; |
93 | 93 |
94 base::WeakPtrFactory<ServiceWorkerFetchDispatcher> weak_factory_; | 94 base::WeakPtrFactory<ServiceWorkerFetchDispatcher> weak_factory_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerFetchDispatcher); | 96 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerFetchDispatcher); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace content | 99 } // namespace content |
100 | 100 |
101 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_FETCH_DISPATCHER_H_ | 101 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_FETCH_DISPATCHER_H_ |
OLD | NEW |