| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 explicit NavigationURLLoaderImplCore( | 38 explicit NavigationURLLoaderImplCore( |
| 39 const base::WeakPtr<NavigationURLLoaderImpl>& loader); | 39 const base::WeakPtr<NavigationURLLoaderImpl>& loader); |
| 40 ~NavigationURLLoaderImplCore(); | 40 ~NavigationURLLoaderImplCore(); |
| 41 | 41 |
| 42 // Starts the request. | 42 // Starts the request. |
| 43 void Start(ResourceContext* resource_context, | 43 void Start(ResourceContext* resource_context, |
| 44 ServiceWorkerNavigationHandleCore* service_worker_handle_core, | 44 ServiceWorkerNavigationHandleCore* service_worker_handle_core, |
| 45 scoped_ptr<NavigationRequestInfo> request_info); | 45 scoped_ptr<NavigationRequestInfo> request_info); |
| 46 | 46 |
| 47 // Follows the current pending redirect. | 47 // Follows the current pending redirect. |
| 48 void FollowRedirect(); | 48 void FollowRedirect( |
| 49 const std::vector<std::pair<std::string, std::string>>& extra_headers); |
| 49 | 50 |
| 50 void set_resource_handler(NavigationResourceHandler* resource_handler) { | 51 void set_resource_handler(NavigationResourceHandler* resource_handler) { |
| 51 resource_handler_ = resource_handler; | 52 resource_handler_ = resource_handler; |
| 52 } | 53 } |
| 53 | 54 |
| 54 // Notifies |loader_| on the UI thread that the request was redirected. | 55 // Notifies |loader_| on the UI thread that the request was redirected. |
| 55 void NotifyRequestRedirected(const net::RedirectInfo& redirect_info, | 56 void NotifyRequestRedirected(const net::RedirectInfo& redirect_info, |
| 56 ResourceResponse* response); | 57 ResourceResponse* response); |
| 57 | 58 |
| 58 // Notifies |loader_| on the UI thread that the response started. | 59 // Notifies |loader_| on the UI thread that the response started. |
| 59 void NotifyResponseStarted(ResourceResponse* response, | 60 void NotifyResponseStarted(ResourceResponse* response, |
| 60 scoped_ptr<StreamHandle> body); | 61 scoped_ptr<StreamHandle> body); |
| 61 | 62 |
| 62 // Notifies |loader_| on the UI thread that the request failed. | 63 // Notifies |loader_| on the UI thread that the request failed. |
| 63 void NotifyRequestFailed(bool in_cache, int net_error); | 64 void NotifyRequestFailed(bool in_cache, int net_error); |
| 64 | 65 |
| 65 private: | 66 private: |
| 66 base::WeakPtr<NavigationURLLoaderImpl> loader_; | 67 base::WeakPtr<NavigationURLLoaderImpl> loader_; |
| 67 NavigationResourceHandler* resource_handler_; | 68 NavigationResourceHandler* resource_handler_; |
| 68 | 69 |
| 69 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderImplCore); | 70 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderImplCore); |
| 70 }; | 71 }; |
| 71 | 72 |
| 72 } // namespace content | 73 } // namespace content |
| 73 | 74 |
| 74 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_CORE_H_ | 75 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_CORE_H_ |
| OLD | NEW |