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