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

Side by Side Diff: chrome/browser/predictors/resource_prefetcher.cc

Issue 12701011: [Net] Propagate priority changes from URLRequest to HttpTransaction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix leaks Created 7 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
« no previous file with comments | « no previous file | chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <iterator> 5 #include <iterator>
6 6
7 #include "chrome/browser/predictors/resource_prefetcher.h" 7 #include "chrome/browser/predictors/resource_prefetcher.h"
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 net::URLRequest* url_request = 124 net::URLRequest* url_request =
125 new net::URLRequest(request->resource_url, 125 new net::URLRequest(request->resource_url,
126 this, 126 this,
127 delegate_->GetURLRequestContext()); 127 delegate_->GetURLRequestContext());
128 inflight_requests_[url_request] = request; 128 inflight_requests_[url_request] = request;
129 host_inflight_counts_[url_request->original_url().host()] += 1; 129 host_inflight_counts_[url_request->original_url().host()] += 1;
130 130
131 url_request->set_method("GET"); 131 url_request->set_method("GET");
132 url_request->set_first_party_for_cookies(navigation_id_.main_frame_url); 132 url_request->set_first_party_for_cookies(navigation_id_.main_frame_url);
133 url_request->set_referrer(navigation_id_.main_frame_url.spec()); 133 url_request->set_referrer(navigation_id_.main_frame_url.spec());
134 url_request->set_priority(net::LOW); 134 url_request->SetPriority(net::LOW);
135 StartURLRequest(url_request); 135 StartURLRequest(url_request);
136 } 136 }
137 137
138 void ResourcePrefetcher::StartURLRequest(net::URLRequest* request) { 138 void ResourcePrefetcher::StartURLRequest(net::URLRequest* request) {
139 request->Start(); 139 request->Start();
140 } 140 }
141 141
142 void ResourcePrefetcher::FinishRequest(net::URLRequest* request, 142 void ResourcePrefetcher::FinishRequest(net::URLRequest* request,
143 Request::PrefetchStatus status) { 143 Request::PrefetchStatus status) {
144 std::map<net::URLRequest*, Request*>::iterator request_it = 144 std::map<net::URLRequest*, Request*>::iterator request_it =
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 if (request->status().error()) { 229 if (request->status().error()) {
230 FinishRequest(request, Request::PREFETCH_STATUS_FAILED); 230 FinishRequest(request, Request::PREFETCH_STATUS_FAILED);
231 return; 231 return;
232 } 232 }
233 233
234 if (ShouldContinueReadingRequest(request, bytes_read)) 234 if (ShouldContinueReadingRequest(request, bytes_read))
235 ReadFullResponse(request); 235 ReadFullResponse(request);
236 } 236 }
237 237
238 } // namespace predictors 238 } // namespace predictors
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698