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

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

Issue 14445: I fail at reading code review comments. Second try at getting the white spac... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 12 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 24 matching lines...) Expand all
35 35
36 if (!request->context() || 36 if (!request->context() ||
37 !request->context()->http_transaction_factory()) { 37 !request->context()->http_transaction_factory()) {
38 NOTREACHED() << "requires a valid context"; 38 NOTREACHED() << "requires a valid context";
39 return new URLRequestErrorJob(request, net::ERR_INVALID_ARGUMENT); 39 return new URLRequestErrorJob(request, net::ERR_INVALID_ARGUMENT);
40 } 40 }
41 41
42 // We cache the value of the switch because this code path is hit on every 42 // We cache the value of the switch because this code path is hit on every
43 // network request. 43 // network request.
44 static const bool kForceHTTPS = 44 static const bool kForceHTTPS =
45 CommandLine().HasSwitch(switches::kForceHTTPS); 45 CommandLine().HasSwitch(switches::kForceHTTPS);
46 if (kForceHTTPS && scheme != "https") 46 if (kForceHTTPS && scheme != "https")
47 return new URLRequestErrorJob(request, net::ERR_DISALLOWED_URL_SCHEME); 47 return new URLRequestErrorJob(request, net::ERR_DISALLOWED_URL_SCHEME);
48 48
49 return new URLRequestHttpJob(request); 49 return new URLRequestHttpJob(request);
50 } 50 }
51 51
52 URLRequestHttpJob::URLRequestHttpJob(URLRequest* request) 52 URLRequestHttpJob::URLRequestHttpJob(URLRequest* request)
53 : URLRequestJob(request), 53 : URLRequestJob(request),
54 transaction_(NULL), 54 transaction_(NULL),
55 response_info_(NULL), 55 response_info_(NULL),
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 // we can just ignore this notification. 378 // we can just ignore this notification.
379 if (!transaction_.get()) 379 if (!transaction_.get())
380 return; 380 return;
381 381
382 // Clear the IO_PENDING status 382 // Clear the IO_PENDING status
383 SetStatus(URLRequestStatus()); 383 SetStatus(URLRequestStatus());
384 384
385 if (result == net::OK) { 385 if (result == net::OK) {
386 NotifyHeadersComplete(); 386 NotifyHeadersComplete();
387 } else if (net::IsCertificateError(result) && 387 } else if (net::IsCertificateError(result) &&
388 !CommandLine().HasSwitch(switches::kForceHTTPS)) { 388 !CommandLine().HasSwitch(switches::kForceHTTPS)) {
389 // We encountered an SSL certificate error. Ask our delegate to decide 389 // We encountered an SSL certificate error. Ask our delegate to decide
390 // what we should do. 390 // what we should do.
391 // TODO(wtc): also pass ssl_info.cert_status, or just pass the whole 391 // TODO(wtc): also pass ssl_info.cert_status, or just pass the whole
392 // ssl_info. 392 // ssl_info.
393 request_->delegate()->OnSSLCertificateError( 393 request_->delegate()->OnSSLCertificateError(
394 request_, result, transaction_->GetResponseInfo()->ssl_info.cert); 394 request_, result, transaction_->GetResponseInfo()->ssl_info.cert);
395 } else { 395 } else {
396 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result)); 396 NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, result));
397 } 397 }
398 } 398 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 DCHECK(response_cookies_.empty()); 545 DCHECK(response_cookies_.empty());
546 546
547 std::string name = "Set-Cookie"; 547 std::string name = "Set-Cookie";
548 std::string value; 548 std::string value;
549 549
550 void* iter = NULL; 550 void* iter = NULL;
551 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) 551 while (response_info_->headers->EnumerateHeader(&iter, name, &value))
552 response_cookies_.push_back(value); 552 response_cookies_.push_back(value);
553 } 553 }
554 554
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698