| 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.h" | 5 #include "content/browser/loader/navigation_url_loader_impl.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 "content/browser/frame_host/navigation_request_info.h" | 9 #include "content/browser/frame_host/navigation_request_info.h" |
| 10 #include "content/browser/loader/navigation_url_loader_delegate.h" | 10 #include "content/browser/loader/navigation_url_loader_delegate.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 service_worker_handle_core, base::Passed(&request_info))); | 34 service_worker_handle_core, base::Passed(&request_info))); |
| 35 } | 35 } |
| 36 | 36 |
| 37 NavigationURLLoaderImpl::~NavigationURLLoaderImpl() { | 37 NavigationURLLoaderImpl::~NavigationURLLoaderImpl() { |
| 38 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 38 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 39 | 39 |
| 40 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, core_); | 40 BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, core_); |
| 41 core_ = nullptr; | 41 core_ = nullptr; |
| 42 } | 42 } |
| 43 | 43 |
| 44 void NavigationURLLoaderImpl::FollowRedirect() { | 44 void NavigationURLLoaderImpl::FollowRedirect( |
| 45 const std::vector<std::pair<std::string, std::string> >& extra_headers) { |
| 45 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 46 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 46 | 47 |
| 47 BrowserThread::PostTask( | 48 BrowserThread::PostTask( |
| 48 BrowserThread::IO, FROM_HERE, | 49 BrowserThread::IO, FROM_HERE, |
| 49 base::Bind(&NavigationURLLoaderImplCore::FollowRedirect, | 50 base::Bind(&NavigationURLLoaderImplCore::FollowRedirect, |
| 50 base::Unretained(core_))); | 51 base::Unretained(core_), extra_headers)); |
| 51 } | 52 } |
| 52 | 53 |
| 53 void NavigationURLLoaderImpl::NotifyRequestRedirected( | 54 void NavigationURLLoaderImpl::NotifyRequestRedirected( |
| 54 const net::RedirectInfo& redirect_info, | 55 const net::RedirectInfo& redirect_info, |
| 55 const scoped_refptr<ResourceResponse>& response) { | 56 const scoped_refptr<ResourceResponse>& response) { |
| 56 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 57 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 57 | 58 |
| 58 delegate_->OnRequestRedirected(redirect_info, response); | 59 delegate_->OnRequestRedirected(redirect_info, response); |
| 59 } | 60 } |
| 60 | 61 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 73 delegate_->OnRequestFailed(in_cache, net_error); | 74 delegate_->OnRequestFailed(in_cache, net_error); |
| 74 } | 75 } |
| 75 | 76 |
| 76 void NavigationURLLoaderImpl::NotifyRequestStarted(base::TimeTicks timestamp) { | 77 void NavigationURLLoaderImpl::NotifyRequestStarted(base::TimeTicks timestamp) { |
| 77 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 78 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 78 | 79 |
| 79 delegate_->OnRequestStarted(timestamp); | 80 delegate_->OnRequestStarted(timestamp); |
| 80 } | 81 } |
| 81 | 82 |
| 82 } // namespace content | 83 } // namespace content |
| OLD | NEW |