| 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 #include "mojo/public/cpp/system/data_pipe.h" |
| 13 | 14 |
| 14 namespace net { | 15 namespace net { |
| 15 class URLRequestContextGetter; | 16 class URLRequestContextGetter; |
| 16 struct RedirectInfo; | 17 struct RedirectInfo; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 | 21 |
| 21 class AppCacheNavigationHandleCore; | 22 class AppCacheNavigationHandleCore; |
| 22 class NavigationResourceHandler; | 23 class NavigationResourceHandler; |
| 23 class NavigationData; | 24 class NavigationData; |
| 24 class ResourceContext; | 25 class ResourceContext; |
| 25 class ServiceWorkerNavigationHandleCore; | 26 class ServiceWorkerNavigationHandleCore; |
| 26 class StreamHandle; | |
| 27 struct GlobalRequestID; | 27 struct GlobalRequestID; |
| 28 struct ResourceResponse; | 28 struct ResourceResponse; |
| 29 struct SSLStatus; | 29 struct SSLStatus; |
| 30 | 30 |
| 31 // The IO-thread counterpart to the NavigationURLLoaderImpl. It lives on the IO | 31 // The IO-thread counterpart to the NavigationURLLoaderImpl. It lives on the IO |
| 32 // thread and is owned by the UI-thread NavigationURLLoaderImpl. | 32 // thread and is owned by the UI-thread NavigationURLLoaderImpl. |
| 33 // NavigationURLLoaderImplCore interacts with the ResourceDispatcherHost stack | 33 // NavigationURLLoaderImplCore interacts with the ResourceDispatcherHost stack |
| 34 // and forwards signals back to the loader on the UI thread. | 34 // and forwards signals back to the loader on the UI thread. |
| 35 class NavigationURLLoaderImplCore { | 35 class NavigationURLLoaderImplCore { |
| 36 public: | 36 public: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 57 void set_resource_handler(NavigationResourceHandler* resource_handler) { | 57 void set_resource_handler(NavigationResourceHandler* resource_handler) { |
| 58 resource_handler_ = resource_handler; | 58 resource_handler_ = resource_handler; |
| 59 } | 59 } |
| 60 | 60 |
| 61 // Notifies |loader_| on the UI thread that the request was redirected. | 61 // Notifies |loader_| on the UI thread that the request was redirected. |
| 62 void NotifyRequestRedirected(const net::RedirectInfo& redirect_info, | 62 void NotifyRequestRedirected(const net::RedirectInfo& redirect_info, |
| 63 ResourceResponse* response); | 63 ResourceResponse* response); |
| 64 | 64 |
| 65 // Notifies |loader_| on the UI thread that the response started. | 65 // Notifies |loader_| on the UI thread that the response started. |
| 66 void NotifyResponseStarted(ResourceResponse* response, | 66 void NotifyResponseStarted(ResourceResponse* response, |
| 67 std::unique_ptr<StreamHandle> body, | 67 mojo::ScopedDataPipeConsumerHandle consumer_handle, |
| 68 const SSLStatus& ssl_status, | 68 const SSLStatus& ssl_status, |
| 69 std::unique_ptr<NavigationData> navigation_data, | 69 std::unique_ptr<NavigationData> navigation_data, |
| 70 const GlobalRequestID& request_id, | 70 const GlobalRequestID& request_id, |
| 71 bool is_download, | 71 bool is_download, |
| 72 bool is_stream); | 72 bool is_stream); |
| 73 | 73 |
| 74 // Notifies |loader_| on the UI thread that the request failed. | 74 // Notifies |loader_| on the UI thread that the request failed. |
| 75 void NotifyRequestFailed(bool in_cache, int net_error); | 75 void NotifyRequestFailed(bool in_cache, int net_error); |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 base::WeakPtr<NavigationURLLoaderImpl> loader_; | 78 base::WeakPtr<NavigationURLLoaderImpl> loader_; |
| 79 NavigationResourceHandler* resource_handler_; | 79 NavigationResourceHandler* resource_handler_; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderImplCore); | 81 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderImplCore); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } // namespace content | 84 } // namespace content |
| 85 | 85 |
| 86 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_CORE_H_ | 86 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_CORE_H_ |
| OLD | NEW |