OLD | NEW |
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // TODO(jar): We need to not fetch dictionaries the first time they are | 327 // TODO(jar): We need to not fetch dictionaries the first time they are |
328 // seen, but rather wait until we can justify their usefulness. | 328 // seen, but rather wait until we can justify their usefulness. |
329 // For now, we will only fetch the first dictionary, which will at least | 329 // For now, we will only fetch the first dictionary, which will at least |
330 // require multiple suggestions before we get additional ones for this site. | 330 // require multiple suggestions before we get additional ones for this site. |
331 // Eventually we should wait until a dictionary is requested several times | 331 // Eventually we should wait until a dictionary is requested several times |
332 // before we even download it (so that we don't waste memory or bandwidth). | 332 // before we even download it (so that we don't waste memory or bandwidth). |
333 if (GetResponseHeaders()->EnumerateHeader(&iter, name, &url_text)) { | 333 if (GetResponseHeaders()->EnumerateHeader(&iter, name, &url_text)) { |
334 // Resolve suggested URL relative to request url. | 334 // Resolve suggested URL relative to request url. |
335 GURL sdch_dictionary_url = request_->url().Resolve(url_text); | 335 GURL sdch_dictionary_url = request_->url().Resolve(url_text); |
336 if (sdch_dictionary_url.is_valid()) { | 336 if (sdch_dictionary_url.is_valid()) { |
337 sdch_manager->FetchDictionary(request_->url(), sdch_dictionary_url); | 337 sdch_manager->OnGetDictionary(request_->url(), sdch_dictionary_url); |
338 } | 338 } |
339 } | 339 } |
340 } | 340 } |
341 | 341 |
342 // The HTTP transaction may be restarted several times for the purposes | 342 // The HTTP transaction may be restarted several times for the purposes |
343 // of sending authorization information. Each time it restarts, we get | 343 // of sending authorization information. Each time it restarts, we get |
344 // notified of the headers completion so that we can update the cookie store. | 344 // notified of the headers completion so that we can update the cookie store. |
345 if (transaction_->IsReadyToRestartForAuth()) { | 345 if (transaction_->IsReadyToRestartForAuth()) { |
346 DCHECK(!response_info_->auth_challenge.get()); | 346 DCHECK(!response_info_->auth_challenge.get()); |
347 // TODO(battre): This breaks the webrequest API for | 347 // TODO(battre): This breaks the webrequest API for |
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 return override_response_headers_.get() ? | 1517 return override_response_headers_.get() ? |
1518 override_response_headers_.get() : | 1518 override_response_headers_.get() : |
1519 transaction_->GetResponseInfo()->headers.get(); | 1519 transaction_->GetResponseInfo()->headers.get(); |
1520 } | 1520 } |
1521 | 1521 |
1522 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1522 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
1523 awaiting_callback_ = false; | 1523 awaiting_callback_ = false; |
1524 } | 1524 } |
1525 | 1525 |
1526 } // namespace net | 1526 } // namespace net |
OLD | NEW |