OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
433 } | 433 } |
434 | 434 |
435 void URLRequestHttpJob::StopCaching() { | 435 void URLRequestHttpJob::StopCaching() { |
436 if (transaction_.get()) | 436 if (transaction_.get()) |
437 transaction_->StopCaching(); | 437 transaction_->StopCaching(); |
438 } | 438 } |
439 | 439 |
440 void URLRequestHttpJob::OnCanGetCookiesCompleted(int policy) { | 440 void URLRequestHttpJob::OnCanGetCookiesCompleted(int policy) { |
441 // If the request was destroyed, then there is no more work to do. | 441 // If the request was destroyed, then there is no more work to do. |
442 if (request_ && request_->delegate()) { | 442 if (request_ && request_->delegate()) { |
443 if (policy == net::ERR_ACCESS_DENIED) { | 443 if (policy == net::ERR_ACCESS_DENIED && |
444 request_->delegate()->OnGetCookies(request_, true); | 444 request_->context()->cookie_store()) { |
445 request_->delegate()->OnGetCookies( | |
446 request_, | |
447 request_->context()->cookie_store()->GetCookieMonster()-> | |
darin (slow to review)
2010/11/24 18:10:47
this is breaking the abstraction of the CookieStor
jochen (gone - plz use gerrit)
2010/11/24 18:45:38
Since the cookies aren't collected for chrome fram
| |
448 GetAllCookiesForURL(request_->url()), | |
449 true); | |
445 } else if (policy == net::OK && request_->context()->cookie_store()) { | 450 } else if (policy == net::OK && request_->context()->cookie_store()) { |
446 request_->delegate()->OnGetCookies(request_, false); | 451 request_->delegate()->OnGetCookies( |
452 request_, | |
453 request_->context()->cookie_store()->GetCookieMonster()-> | |
454 GetAllCookiesForURL(request_->url()), | |
455 false); | |
447 net::CookieOptions options; | 456 net::CookieOptions options; |
448 options.set_include_httponly(); | 457 options.set_include_httponly(); |
449 std::string cookies = | 458 std::string cookies = |
450 request_->context()->cookie_store()->GetCookiesWithOptions( | 459 request_->context()->cookie_store()->GetCookiesWithOptions( |
451 request_->url(), options); | 460 request_->url(), options); |
452 if (!cookies.empty()) { | 461 if (!cookies.empty()) { |
453 request_info_.extra_headers.SetHeader( | 462 request_info_.extra_headers.SetHeader( |
454 net::HttpRequestHeaders::kCookie, cookies); | 463 net::HttpRequestHeaders::kCookie, cookies); |
455 } | 464 } |
456 } | 465 } |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
916 HTTPSProberDelegate* delegate = | 925 HTTPSProberDelegate* delegate = |
917 new HTTPSProberDelegate(request_info_.url.host(), max_age, | 926 new HTTPSProberDelegate(request_info_.url.host(), max_age, |
918 include_subdomains, | 927 include_subdomains, |
919 ctx->transport_security_state()); | 928 ctx->transport_security_state()); |
920 if (!prober->ProbeHost(request_info_.url.host(), request()->context(), | 929 if (!prober->ProbeHost(request_info_.url.host(), request()->context(), |
921 delegate)) { | 930 delegate)) { |
922 delete delegate; | 931 delete delegate; |
923 } | 932 } |
924 } | 933 } |
925 } | 934 } |
OLD | NEW |