| 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 #include "content/browser/loader/navigation_url_loader_impl_core.h" | 5 #include "content/browser/loader/navigation_url_loader_impl_core.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/browser/frame_host/navigation_request_info.h" | 10 #include "content/browser/frame_host/navigation_request_info.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 NavigationURLLoaderImplCore::~NavigationURLLoaderImplCore() { | 31 NavigationURLLoaderImplCore::~NavigationURLLoaderImplCore() { |
| 32 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 32 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 33 | 33 |
| 34 if (resource_handler_) | 34 if (resource_handler_) |
| 35 resource_handler_->Cancel(); | 35 resource_handler_->Cancel(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void NavigationURLLoaderImplCore::Start( | 38 void NavigationURLLoaderImplCore::Start( |
| 39 ResourceContext* resource_context, | 39 ResourceContext* resource_context, |
| 40 int64 frame_tree_node_id, | 40 int64 frame_tree_node_id, |
| 41 const CommonNavigationParams& common_params, | 41 scoped_ptr<NavigationRequestInfo> request_info) { |
| 42 scoped_ptr<NavigationRequestInfo> request_info, | |
| 43 ResourceRequestBody* request_body) { | |
| 44 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 42 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 45 | 43 |
| 46 BrowserThread::PostTask( | 44 BrowserThread::PostTask( |
| 47 BrowserThread::UI, FROM_HERE, | 45 BrowserThread::UI, FROM_HERE, |
| 48 base::Bind(&NavigationURLLoaderImpl::NotifyRequestStarted, loader_, | 46 base::Bind(&NavigationURLLoaderImpl::NotifyRequestStarted, loader_, |
| 49 base::TimeTicks::Now())); | 47 base::TimeTicks::Now())); |
| 50 | 48 |
| 51 ResourceDispatcherHostImpl::Get()->BeginNavigationRequest( | 49 ResourceDispatcherHostImpl::Get()->BeginNavigationRequest( |
| 52 resource_context, frame_tree_node_id, | 50 resource_context, frame_tree_node_id, |
| 53 common_params, *request_info, request_body, | 51 *request_info, this); |
| 54 this); | |
| 55 } | 52 } |
| 56 | 53 |
| 57 void NavigationURLLoaderImplCore::FollowRedirect() { | 54 void NavigationURLLoaderImplCore::FollowRedirect() { |
| 58 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 55 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 59 | 56 |
| 60 if (resource_handler_) | 57 if (resource_handler_) |
| 61 resource_handler_->FollowRedirect(); | 58 resource_handler_->FollowRedirect(); |
| 62 } | 59 } |
| 63 | 60 |
| 64 | 61 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 void NavigationURLLoaderImplCore::NotifyRequestFailed(int net_error) { | 98 void NavigationURLLoaderImplCore::NotifyRequestFailed(int net_error) { |
| 102 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 99 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 103 | 100 |
| 104 BrowserThread::PostTask( | 101 BrowserThread::PostTask( |
| 105 BrowserThread::UI, FROM_HERE, | 102 BrowserThread::UI, FROM_HERE, |
| 106 base::Bind(&NavigationURLLoaderImpl::NotifyRequestFailed, loader_, | 103 base::Bind(&NavigationURLLoaderImpl::NotifyRequestFailed, loader_, |
| 107 net_error)); | 104 net_error)); |
| 108 } | 105 } |
| 109 | 106 |
| 110 } // namespace content | 107 } // namespace content |
| OLD | NEW |