| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "content/test/test_navigation_url_loader.h" | 5 #include "content/test/test_navigation_url_loader.h" |
| 6 | 6 |
| 7 #include "content/browser/loader/navigation_url_loader_delegate.h" | 7 #include "content/browser/loader/navigation_url_loader_delegate.h" |
| 8 #include "content/public/browser/stream_handle.h" | 8 #include "content/public/browser/stream_handle.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 TestNavigationURLLoader::TestNavigationURLLoader( | 12 TestNavigationURLLoader::TestNavigationURLLoader( |
| 13 const CommonNavigationParams& common_params, | |
| 14 scoped_ptr<NavigationRequestInfo> request_info, | 13 scoped_ptr<NavigationRequestInfo> request_info, |
| 15 NavigationURLLoaderDelegate* delegate) | 14 NavigationURLLoaderDelegate* delegate) |
| 16 : common_params_(common_params), | 15 : request_info_(request_info.Pass()), |
| 17 request_info_(request_info.Pass()), | |
| 18 delegate_(delegate), | 16 delegate_(delegate), |
| 19 redirect_count_(0) { | 17 redirect_count_(0) { |
| 20 } | 18 } |
| 21 | 19 |
| 22 void TestNavigationURLLoader::FollowRedirect() { | 20 void TestNavigationURLLoader::FollowRedirect() { |
| 23 redirect_count_++; | 21 redirect_count_++; |
| 24 } | 22 } |
| 25 | 23 |
| 26 void TestNavigationURLLoader::CallOnRequestRedirected( | 24 void TestNavigationURLLoader::CallOnRequestRedirected( |
| 27 const net::RedirectInfo& redirect_info, | 25 const net::RedirectInfo& redirect_info, |
| 28 const scoped_refptr<ResourceResponse>& response) { | 26 const scoped_refptr<ResourceResponse>& response) { |
| 29 delegate_->OnRequestRedirected(redirect_info, response); | 27 delegate_->OnRequestRedirected(redirect_info, response); |
| 30 } | 28 } |
| 31 | 29 |
| 32 void TestNavigationURLLoader::CallOnResponseStarted( | 30 void TestNavigationURLLoader::CallOnResponseStarted( |
| 33 const scoped_refptr<ResourceResponse>& response, | 31 const scoped_refptr<ResourceResponse>& response, |
| 34 scoped_ptr<StreamHandle> body) { | 32 scoped_ptr<StreamHandle> body) { |
| 35 delegate_->OnResponseStarted(response, body.Pass()); | 33 delegate_->OnResponseStarted(response, body.Pass()); |
| 36 } | 34 } |
| 37 | 35 |
| 38 TestNavigationURLLoader::~TestNavigationURLLoader() {} | 36 TestNavigationURLLoader::~TestNavigationURLLoader() {} |
| 39 | 37 |
| 40 } // namespace content | 38 } // namespace content |
| OLD | NEW |