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