Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: content/browser/loader/navigation_url_loader_impl.cc

Issue 1416953007: Add a function to add extra headers from NavigationThrottle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data-reduction-proxy-resource-throttle
Patch Set: Fixed compilation issue Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698