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

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 664263002: Restructure SDCH layering to allow more separation (observer/1->[0,n] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync'd to 303035. Created 6 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
« no previous file with comments | « net/url_request/sdch_dictionary_fetcher_unittest.cc ('k') | no next file » | 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 "net/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 // TODO(jar): We need to not fetch dictionaries the first time they are 328 // TODO(jar): We need to not fetch dictionaries the first time they are
329 // seen, but rather wait until we can justify their usefulness. 329 // seen, but rather wait until we can justify their usefulness.
330 // For now, we will only fetch the first dictionary, which will at least 330 // For now, we will only fetch the first dictionary, which will at least
331 // require multiple suggestions before we get additional ones for this site. 331 // require multiple suggestions before we get additional ones for this site.
332 // Eventually we should wait until a dictionary is requested several times 332 // Eventually we should wait until a dictionary is requested several times
333 // before we even download it (so that we don't waste memory or bandwidth). 333 // before we even download it (so that we don't waste memory or bandwidth).
334 if (GetResponseHeaders()->EnumerateHeader(&iter, name, &url_text)) { 334 if (GetResponseHeaders()->EnumerateHeader(&iter, name, &url_text)) {
335 // Resolve suggested URL relative to request url. 335 // Resolve suggested URL relative to request url.
336 GURL sdch_dictionary_url = request_->url().Resolve(url_text); 336 GURL sdch_dictionary_url = request_->url().Resolve(url_text);
337 if (sdch_dictionary_url.is_valid()) { 337 if (sdch_dictionary_url.is_valid()) {
338 sdch_manager->FetchDictionary(request_->url(), sdch_dictionary_url); 338 sdch_manager->OnGetDictionary(request_->url(), sdch_dictionary_url);
339 } 339 }
340 } 340 }
341 } 341 }
342 342
343 // The HTTP transaction may be restarted several times for the purposes 343 // The HTTP transaction may be restarted several times for the purposes
344 // of sending authorization information. Each time it restarts, we get 344 // of sending authorization information. Each time it restarts, we get
345 // notified of the headers completion so that we can update the cookie store. 345 // notified of the headers completion so that we can update the cookie store.
346 if (transaction_->IsReadyToRestartForAuth()) { 346 if (transaction_->IsReadyToRestartForAuth()) {
347 DCHECK(!response_info_->auth_challenge.get()); 347 DCHECK(!response_info_->auth_challenge.get());
348 // TODO(battre): This breaks the webrequest API for 348 // TODO(battre): This breaks the webrequest API for
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 return override_response_headers_.get() ? 1528 return override_response_headers_.get() ?
1529 override_response_headers_.get() : 1529 override_response_headers_.get() :
1530 transaction_->GetResponseInfo()->headers.get(); 1530 transaction_->GetResponseInfo()->headers.get();
1531 } 1531 }
1532 1532
1533 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1533 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1534 awaiting_callback_ = false; 1534 awaiting_callback_ = false;
1535 } 1535 }
1536 1536
1537 } // namespace net 1537 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/sdch_dictionary_fetcher_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698