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

Side by Side Diff: chrome/browser/net/spdyproxy/proxy_advisor.cc

Issue 197043005: original change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: fix other build error Created 6 years, 9 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/net/spdyproxy/proxy_advisor.h" 5 #include "chrome/browser/net/spdyproxy/proxy_advisor.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 if (!WouldProxyURL(url)) 113 if (!WouldProxyURL(url))
114 return; 114 return;
115 115
116 std::string motivation_name(MotivationName(motivation, is_preconnect)); 116 std::string motivation_name(MotivationName(motivation, is_preconnect));
117 std::string header_value = motivation_name + " " + url.spec(); 117 std::string header_value = motivation_name + " " + url.spec();
118 net::URLRequestContext* context = context_getter_->GetURLRequestContext(); 118 net::URLRequestContext* context = context_getter_->GetURLRequestContext();
119 std::string endpoint = 119 std::string endpoint =
120 DataReductionProxySettings::GetDataReductionProxyOrigin() + "preconnect"; 120 DataReductionProxySettings::GetDataReductionProxyOrigin() + "preconnect";
121 scoped_ptr<net::URLRequest> request = context->CreateRequest( 121 scoped_ptr<net::URLRequest> request = context->CreateRequest(
122 GURL(endpoint), net::DEFAULT_PRIORITY, this); 122 GURL(endpoint), net::DEFAULT_PRIORITY, this, NULL);
123 request->set_method("HEAD"); 123 request->set_method("HEAD");
124 request->SetExtraRequestHeaderByName( 124 request->SetExtraRequestHeaderByName(
125 "Proxy-Host-Advisory", header_value, false); 125 "Proxy-Host-Advisory", header_value, false);
126 request->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | 126 request->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
127 net::LOAD_DO_NOT_SAVE_COOKIES | 127 net::LOAD_DO_NOT_SAVE_COOKIES |
128 net::LOAD_BYPASS_PROXY | 128 net::LOAD_BYPASS_PROXY |
129 net::LOAD_DISABLE_CACHE); 129 net::LOAD_DISABLE_CACHE);
130 net::URLRequest* raw_request = request.get(); 130 net::URLRequest* raw_request = request.get();
131 inflight_requests_.insert(request.release()); 131 inflight_requests_.insert(request.release());
132 raw_request->Start(); 132 raw_request->Start();
(...skipping 17 matching lines...) Expand all
150 scoped_ptr<net::URLRequest> scoped_request_for_deletion(request); 150 scoped_ptr<net::URLRequest> scoped_request_for_deletion(request);
151 inflight_requests_.erase(request); 151 inflight_requests_.erase(request);
152 // |scoped_request_for_deletion| will delete |request| 152 // |scoped_request_for_deletion| will delete |request|
153 } 153 }
154 154
155 void ProxyAdvisor::UpdateProxyState() { 155 void ProxyAdvisor::UpdateProxyState() {
156 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 156 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
157 // Delete all inflight requests. Each request's destructor will call Cancel(). 157 // Delete all inflight requests. Each request's destructor will call Cancel().
158 STLDeleteElements(&inflight_requests_); 158 STLDeleteElements(&inflight_requests_);
159 } 159 }
OLDNEW
« no previous file with comments | « chrome/browser/net/http_pipelining_compatibility_client.cc ('k') | chrome/browser/plugins/plugin_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698