| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class FrameTreeNode; | 22 class FrameTreeNode; |
| 23 class NavigationResourceHandler; | 23 class NavigationResourceHandler; |
| 24 class NavigationData; | 24 class NavigationData; |
| 25 class ResourceContext; | 25 class ResourceContext; |
| 26 class ResourceHandler; | 26 class ResourceHandler; |
| 27 class ResourceRequestBody; | 27 class ResourceRequestBody; |
| 28 class ServiceWorkerContextWrapper; | 28 class ServiceWorkerContextWrapper; |
| 29 class ServiceWorkerRegistration; | 29 class ServiceWorkerRegistration; |
| 30 class StreamHandle; | 30 class StreamHandle; |
| 31 struct ResourceResponse; | 31 struct ResourceResponse; |
| 32 struct SSLStatus; |
| 32 | 33 |
| 33 // The IO-thread counterpart to the NavigationURLLoaderImpl. It lives on the IO | 34 // The IO-thread counterpart to the NavigationURLLoaderImpl. It lives on the IO |
| 34 // thread and is owned by the UI-thread NavigationURLLoaderImpl. | 35 // thread and is owned by the UI-thread NavigationURLLoaderImpl. |
| 35 // NavigationURLLoaderImplCore interacts with the ResourceDispatcherHost stack | 36 // NavigationURLLoaderImplCore interacts with the ResourceDispatcherHost stack |
| 36 // and forwards signals back to the loader on the UI thread. | 37 // and forwards signals back to the loader on the UI thread. |
| 37 class NavigationURLLoaderImplCore { | 38 class NavigationURLLoaderImplCore { |
| 38 public: | 39 public: |
| 39 // Creates a new NavigationURLLoaderImplCore that forwards signals back to | 40 // Creates a new NavigationURLLoaderImplCore that forwards signals back to |
| 40 // |loader| on the UI thread. | 41 // |loader| on the UI thread. |
| 41 explicit NavigationURLLoaderImplCore( | 42 explicit NavigationURLLoaderImplCore( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 57 resource_handler_ = resource_handler; | 58 resource_handler_ = resource_handler; |
| 58 } | 59 } |
| 59 | 60 |
| 60 // Notifies |loader_| on the UI thread that the request was redirected. | 61 // Notifies |loader_| on the UI thread that the request was redirected. |
| 61 void NotifyRequestRedirected(const net::RedirectInfo& redirect_info, | 62 void NotifyRequestRedirected(const net::RedirectInfo& redirect_info, |
| 62 ResourceResponse* response); | 63 ResourceResponse* response); |
| 63 | 64 |
| 64 // Notifies |loader_| on the UI thread that the response started. | 65 // Notifies |loader_| on the UI thread that the response started. |
| 65 void NotifyResponseStarted(ResourceResponse* response, | 66 void NotifyResponseStarted(ResourceResponse* response, |
| 66 std::unique_ptr<StreamHandle> body, | 67 std::unique_ptr<StreamHandle> body, |
| 68 const SSLStatus& ssl_status, |
| 67 std::unique_ptr<NavigationData> navigation_data); | 69 std::unique_ptr<NavigationData> navigation_data); |
| 68 | 70 |
| 69 // Notifies |loader_| on the UI thread that the request failed. | 71 // Notifies |loader_| on the UI thread that the request failed. |
| 70 void NotifyRequestFailed(bool in_cache, int net_error); | 72 void NotifyRequestFailed(bool in_cache, int net_error); |
| 71 | 73 |
| 72 private: | 74 private: |
| 73 // Called when done checking whether the navigation has a ServiceWorker | 75 // Called when done checking whether the navigation has a ServiceWorker |
| 74 // registered for it. | 76 // registered for it. |
| 75 void OnServiceWorkerChecksPerformed( | 77 void OnServiceWorkerChecksPerformed( |
| 76 ServiceWorkerStatusCode status, | 78 ServiceWorkerStatusCode status, |
| 77 scoped_refptr<ServiceWorkerRegistration> registration); | 79 scoped_refptr<ServiceWorkerRegistration> registration); |
| 78 | 80 |
| 79 base::WeakPtr<NavigationURLLoaderImpl> loader_; | 81 base::WeakPtr<NavigationURLLoaderImpl> loader_; |
| 80 NavigationResourceHandler* resource_handler_; | 82 NavigationResourceHandler* resource_handler_; |
| 81 std::unique_ptr<NavigationRequestInfo> request_info_; | 83 std::unique_ptr<NavigationRequestInfo> request_info_; |
| 82 ResourceContext* resource_context_; | 84 ResourceContext* resource_context_; |
| 83 | 85 |
| 84 base::WeakPtrFactory<NavigationURLLoaderImplCore> factory_; | 86 base::WeakPtrFactory<NavigationURLLoaderImplCore> factory_; |
| 85 | 87 |
| 86 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderImplCore); | 88 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderImplCore); |
| 87 }; | 89 }; |
| 88 | 90 |
| 89 } // namespace content | 91 } // namespace content |
| 90 | 92 |
| 91 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_CORE_H_ | 93 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_CORE_H_ |
| OLD | NEW |