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

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

Issue 11417148: Query the network delegate for cookies even if there is no cookie monster (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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/url_request.h ('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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 // No matter what, we want to report our status as IO pending since we will 501 // No matter what, we want to report our status as IO pending since we will
502 // be notifying our consumer asynchronously via OnStartCompleted. 502 // be notifying our consumer asynchronously via OnStartCompleted.
503 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); 503 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
504 504
505 // If the request was destroyed, then there is no more work to do. 505 // If the request was destroyed, then there is no more work to do.
506 if (!request_) 506 if (!request_)
507 return; 507 return;
508 508
509 CookieStore* cookie_store = request_->context()->cookie_store(); 509 CookieStore* cookie_store = request_->context()->cookie_store();
510 if (cookie_store && !(request_info_.load_flags & LOAD_DO_NOT_SEND_COOKIES)) { 510 if (cookie_store && !(request_info_.load_flags & LOAD_DO_NOT_SEND_COOKIES)) {
511 net::CookieMonster* cookie_monster = cookie_store->GetCookieMonster(); 511 net::CookieMonster* cookie_monster = cookie_store->GetCookieMonster();
cbentzel 2012/11/28 14:33:13 Question more for Erik: I find all the GetCookieMo
erikwright (departed) 2012/11/30 16:43:52 GetAllCookiesForURLAsync is returning full metadat
512 if (cookie_monster) { 512 if (cookie_monster) {
513 cookie_monster->GetAllCookiesForURLAsync( 513 cookie_monster->GetAllCookiesForURLAsync(
514 request_->url(), 514 request_->url(),
515 base::Bind(&URLRequestHttpJob::CheckCookiePolicyAndLoad, 515 base::Bind(&URLRequestHttpJob::CheckCookiePolicyAndLoad,
516 weak_factory_.GetWeakPtr())); 516 weak_factory_.GetWeakPtr()));
517 } else { 517 } else {
518 DoLoadCookies(); 518 CheckCookiePolicyAndLoad(CookieList());
droger 2012/11/23 16:00:12 I pass an empty list as 'default' argument here, a
erikwright (departed) 2012/11/27 05:17:17 ChromeNetworkDelegate passes the list to TabSpecif
cbentzel 2012/11/28 14:36:42 Out of curiosity: is the Cookie header already sup
droger 2012/11/28 14:47:44 Looking at the code, the headers are set a bit aft
erikwright (departed) 2012/11/30 16:43:52 The problem is that the CookieList is cookies with
519 } 519 }
520 } else { 520 } else {
521 DoStartTransaction(); 521 DoStartTransaction();
522 } 522 }
523 } 523 }
524 524
525 void URLRequestHttpJob::DoLoadCookies() { 525 void URLRequestHttpJob::DoLoadCookies() {
526 CookieOptions options; 526 CookieOptions options;
527 options.set_include_httponly(); 527 options.set_include_httponly();
528 request_->context()->cookie_store()->GetCookiesWithInfoAsync( 528 request_->context()->cookie_store()->GetCookiesWithInfoAsync(
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 1576
1577 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1577 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1578 awaiting_callback_ = false; 1578 awaiting_callback_ = false;
1579 } 1579 }
1580 1580
1581 void URLRequestHttpJob::OnDetachRequest() { 1581 void URLRequestHttpJob::OnDetachRequest() {
1582 http_transaction_delegate_->OnDetachRequest(); 1582 http_transaction_delegate_->OnDetachRequest();
1583 } 1583 }
1584 1584
1585 } // namespace net 1585 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698