| 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_LOADER_NAVIGATION_URL_LOADER_IMPL_CORE_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_CORE_H_ |
| 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_CORE_H_ | 6 #define CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_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/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "content/browser/loader/navigation_url_loader_impl.h" | 12 #include "content/browser/loader/navigation_url_loader_impl.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 struct RedirectInfo; | 15 struct RedirectInfo; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 class AppCacheNavigationHandleCore; |
| 20 class NavigationResourceHandler; | 21 class NavigationResourceHandler; |
| 21 class NavigationData; | 22 class NavigationData; |
| 22 class ResourceContext; | 23 class ResourceContext; |
| 23 class ResourceHandler; | 24 class ResourceHandler; |
| 24 class ServiceWorkerNavigationHandleCore; | 25 class ServiceWorkerNavigationHandleCore; |
| 25 class StreamHandle; | 26 class StreamHandle; |
| 26 struct ResourceResponse; | 27 struct ResourceResponse; |
| 27 struct SSLStatus; | 28 struct SSLStatus; |
| 28 | 29 |
| 29 // The IO-thread counterpart to the NavigationURLLoaderImpl. It lives on the IO | 30 // The IO-thread counterpart to the NavigationURLLoaderImpl. It lives on the IO |
| 30 // thread and is owned by the UI-thread NavigationURLLoaderImpl. | 31 // thread and is owned by the UI-thread NavigationURLLoaderImpl. |
| 31 // NavigationURLLoaderImplCore interacts with the ResourceDispatcherHost stack | 32 // NavigationURLLoaderImplCore interacts with the ResourceDispatcherHost stack |
| 32 // and forwards signals back to the loader on the UI thread. | 33 // and forwards signals back to the loader on the UI thread. |
| 33 class NavigationURLLoaderImplCore { | 34 class NavigationURLLoaderImplCore { |
| 34 public: | 35 public: |
| 35 // Creates a new NavigationURLLoaderImplCore that forwards signals back to | 36 // Creates a new NavigationURLLoaderImplCore that forwards signals back to |
| 36 // |loader| on the UI thread. | 37 // |loader| on the UI thread. |
| 37 explicit NavigationURLLoaderImplCore( | 38 explicit NavigationURLLoaderImplCore( |
| 38 const base::WeakPtr<NavigationURLLoaderImpl>& loader); | 39 const base::WeakPtr<NavigationURLLoaderImpl>& loader); |
| 39 ~NavigationURLLoaderImplCore(); | 40 ~NavigationURLLoaderImplCore(); |
| 40 | 41 |
| 41 // Starts the request. | 42 // Starts the request. |
| 42 void Start(ResourceContext* resource_context, | 43 void Start(ResourceContext* resource_context, |
| 43 ServiceWorkerNavigationHandleCore* service_worker_handle_core, | 44 ServiceWorkerNavigationHandleCore* service_worker_handle_core, |
| 45 AppCacheNavigationHandleCore* appcache_handle_core, |
| 44 std::unique_ptr<NavigationRequestInfo> request_info, | 46 std::unique_ptr<NavigationRequestInfo> request_info, |
| 45 std::unique_ptr<NavigationUIData> navigation_ui_data); | 47 std::unique_ptr<NavigationUIData> navigation_ui_data); |
| 46 | 48 |
| 47 // Follows the current pending redirect. | 49 // Follows the current pending redirect. |
| 48 void FollowRedirect(); | 50 void FollowRedirect(); |
| 49 | 51 |
| 50 // Proceeds with processing the response. | 52 // Proceeds with processing the response. |
| 51 void ProceedWithResponse(); | 53 void ProceedWithResponse(); |
| 52 | 54 |
| 53 void set_resource_handler(NavigationResourceHandler* resource_handler) { | 55 void set_resource_handler(NavigationResourceHandler* resource_handler) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 70 private: | 72 private: |
| 71 base::WeakPtr<NavigationURLLoaderImpl> loader_; | 73 base::WeakPtr<NavigationURLLoaderImpl> loader_; |
| 72 NavigationResourceHandler* resource_handler_; | 74 NavigationResourceHandler* resource_handler_; |
| 73 | 75 |
| 74 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderImplCore); | 76 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderImplCore); |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 } // namespace content | 79 } // namespace content |
| 78 | 80 |
| 79 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_CORE_H_ | 81 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_CORE_H_ |
| OLD | NEW |