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

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

Issue 20146: Add a null pointer check for transaction_ in... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 months 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // which will cause the consumer to receive OnResponseStarted instead of 322 // which will cause the consumer to receive OnResponseStarted instead of
323 // OnAuthRequired. 323 // OnAuthRequired.
324 // 324 //
325 // We have to do this via InvokeLater to avoid "recursing" the consumer. 325 // We have to do this via InvokeLater to avoid "recursing" the consumer.
326 // 326 //
327 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( 327 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
328 this, &URLRequestHttpJob::OnStartCompleted, net::OK)); 328 this, &URLRequestHttpJob::OnStartCompleted, net::OK));
329 } 329 }
330 330
331 void URLRequestHttpJob::ContinueDespiteLastError() { 331 void URLRequestHttpJob::ContinueDespiteLastError() {
332 DCHECK(transaction_.get()); 332 // If the transaction was destroyed, then the job was cancelled.
333 if (!transaction_.get())
334 return;
335
333 DCHECK(!response_info_) << "should not have a response yet"; 336 DCHECK(!response_info_) << "should not have a response yet";
334 337
335 // No matter what, we want to report our status as IO pending since we will 338 // No matter what, we want to report our status as IO pending since we will
336 // be notifying our consumer asynchronously via OnStartCompleted. 339 // be notifying our consumer asynchronously via OnStartCompleted.
337 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); 340 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
338 341
339 int rv = transaction_->RestartIgnoringLastError(&start_callback_); 342 int rv = transaction_->RestartIgnoringLastError(&start_callback_);
340 if (rv == net::ERR_IO_PENDING) 343 if (rv == net::ERR_IO_PENDING)
341 return; 344 return;
342 345
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 DCHECK(response_cookies_.empty()); 552 DCHECK(response_cookies_.empty());
550 553
551 std::string name = "Set-Cookie"; 554 std::string name = "Set-Cookie";
552 std::string value; 555 std::string value;
553 556
554 void* iter = NULL; 557 void* iter = NULL;
555 while (response_info_->headers->EnumerateHeader(&iter, name, &value)) 558 while (response_info_->headers->EnumerateHeader(&iter, name, &value))
556 response_cookies_.push_back(value); 559 response_cookies_.push_back(value);
557 } 560 }
558 561
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