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

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

Issue 1003953008: Remove prerender cookie store, part 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prerender-revert-cookie-store-3
Patch Set: rebase (just in case since this is so huge) Created 5 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
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 "chrome/browser/predictors/resource_prefetcher.h" 5 #include "chrome/browser/predictors/resource_prefetcher.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/profiler/scoped_tracker.h" 9 #include "base/profiler/scoped_tracker.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 state_ = FINISHED; 120 state_ = FINISHED;
121 delegate_->ResourcePrefetcherFinished(this, request_vector_.release()); 121 delegate_->ResourcePrefetcherFinished(this, request_vector_.release());
122 } 122 }
123 } 123 }
124 124
125 void ResourcePrefetcher::SendRequest(Request* request) { 125 void ResourcePrefetcher::SendRequest(Request* request) {
126 request->prefetch_status = Request::PREFETCH_STATUS_STARTED; 126 request->prefetch_status = Request::PREFETCH_STATUS_STARTED;
127 127
128 net::URLRequest* url_request = 128 net::URLRequest* url_request =
129 delegate_->GetURLRequestContext()->CreateRequest( 129 delegate_->GetURLRequestContext()->CreateRequest(
130 request->resource_url, net::LOW, this, NULL).release(); 130 request->resource_url, net::LOW, this).release();
131 131
132 inflight_requests_[url_request] = request; 132 inflight_requests_[url_request] = request;
133 host_inflight_counts_[url_request->original_url().host()] += 1; 133 host_inflight_counts_[url_request->original_url().host()] += 1;
134 134
135 url_request->set_method("GET"); 135 url_request->set_method("GET");
136 url_request->set_first_party_for_cookies(navigation_id_.main_frame_url); 136 url_request->set_first_party_for_cookies(navigation_id_.main_frame_url);
137 url_request->SetReferrer(navigation_id_.main_frame_url.spec()); 137 url_request->SetReferrer(navigation_id_.main_frame_url.spec());
138 url_request->SetLoadFlags(url_request->load_flags() | net::LOAD_PREFETCH); 138 url_request->SetLoadFlags(url_request->load_flags() | net::LOAD_PREFETCH);
139 StartURLRequest(url_request); 139 StartURLRequest(url_request);
140 } 140 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 if (request->status().error()) { 244 if (request->status().error()) {
245 FinishRequest(request, Request::PREFETCH_STATUS_FAILED); 245 FinishRequest(request, Request::PREFETCH_STATUS_FAILED);
246 return; 246 return;
247 } 247 }
248 248
249 if (ShouldContinueReadingRequest(request, bytes_read)) 249 if (ShouldContinueReadingRequest(request, bytes_read))
250 ReadFullResponse(request); 250 ReadFullResponse(request);
251 } 251 }
252 252
253 } // namespace predictors 253 } // namespace predictors
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698