| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 void NavigationURLLoaderImplCore::FollowRedirect() { | 57 void NavigationURLLoaderImplCore::FollowRedirect() { |
| 58 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 58 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 59 | 59 |
| 60 if (resource_handler_) | 60 if (resource_handler_) |
| 61 resource_handler_->FollowRedirect(); | 61 resource_handler_->FollowRedirect(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void NavigationURLLoaderImplCore::ProceedWithResponse() { |
| 65 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 66 |
| 67 if (resource_handler_) |
| 68 resource_handler_->ProceedWithResponse(); |
| 69 } |
| 70 |
| 64 void NavigationURLLoaderImplCore::NotifyRequestRedirected( | 71 void NavigationURLLoaderImplCore::NotifyRequestRedirected( |
| 65 const net::RedirectInfo& redirect_info, | 72 const net::RedirectInfo& redirect_info, |
| 66 ResourceResponse* response) { | 73 ResourceResponse* response) { |
| 67 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 74 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 68 TRACE_EVENT_ASYNC_END0("navigation", "Navigation redirectDelay", this); | 75 TRACE_EVENT_ASYNC_END0("navigation", "Navigation redirectDelay", this); |
| 69 | 76 |
| 70 // Make a copy of the ResourceResponse before it is passed to another thread. | 77 // Make a copy of the ResourceResponse before it is passed to another thread. |
| 71 // | 78 // |
| 72 // TODO(davidben): This copy could be avoided if ResourceResponse weren't | 79 // TODO(davidben): This copy could be avoided if ResourceResponse weren't |
| 73 // reference counted and the loader stack passed unique ownership of the | 80 // reference counted and the loader stack passed unique ownership of the |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 "&NavigationURLLoaderImplCore", this, "success", | 123 "&NavigationURLLoaderImplCore", this, "success", |
| 117 false); | 124 false); |
| 118 | 125 |
| 119 BrowserThread::PostTask( | 126 BrowserThread::PostTask( |
| 120 BrowserThread::UI, FROM_HERE, | 127 BrowserThread::UI, FROM_HERE, |
| 121 base::Bind(&NavigationURLLoaderImpl::NotifyRequestFailed, loader_, | 128 base::Bind(&NavigationURLLoaderImpl::NotifyRequestFailed, loader_, |
| 122 in_cache, net_error)); | 129 in_cache, net_error)); |
| 123 } | 130 } |
| 124 | 131 |
| 125 } // namespace content | 132 } // namespace content |
| OLD | NEW |