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

Side by Side Diff: webkit/glue/alt_404_page_resource_fetcher.cc

Issue 155166: The WebURLResponse will be null if the network request fails. So, a null che... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | webkit/glue/alt_error_page_resource_fetcher.cc » ('j') | 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 "config.h" 5 #include "config.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 8
9 MSVC_PUSH_WARNING_LEVEL(0); 9 MSVC_PUSH_WARNING_LEVEL(0);
10 #include "DocumentLoader.h" 10 #include "DocumentLoader.h"
(...skipping 24 matching lines...) Expand all
35 doc_loader_(doc_loader) { 35 doc_loader_(doc_loader) {
36 36
37 fetcher_.reset(new ResourceFetcherWithTimeout( 37 fetcher_.reset(new ResourceFetcherWithTimeout(
38 url, WebFrameImpl::FromFrame(frame), kDownloadTimeoutSec, 38 url, WebFrameImpl::FromFrame(frame), kDownloadTimeoutSec,
39 NewCallback(this, &Alt404PageResourceFetcher::OnURLFetchComplete))); 39 NewCallback(this, &Alt404PageResourceFetcher::OnURLFetchComplete)));
40 } 40 }
41 41
42 void Alt404PageResourceFetcher::OnURLFetchComplete( 42 void Alt404PageResourceFetcher::OnURLFetchComplete(
43 const WebURLResponse& response, 43 const WebURLResponse& response,
44 const std::string& data) { 44 const std::string& data) {
45 if (response.httpStatusCode() == 200) { 45 if (!response.isNull() && response.httpStatusCode() == 200) {
46 // Only show server response if we got a 200. 46 // Only show server response if we got a 200.
47 webframeloaderclient_->Alt404PageFinished(doc_loader_.get(), data); 47 webframeloaderclient_->Alt404PageFinished(doc_loader_.get(), data);
48 } else { 48 } else {
49 webframeloaderclient_->Alt404PageFinished(doc_loader_.get(), std::string()); 49 webframeloaderclient_->Alt404PageFinished(doc_loader_.get(), std::string());
50 } 50 }
51 doc_loader_ = NULL; 51 doc_loader_ = NULL;
52 } 52 }
53 53
54 } // namespace webkit_glue 54 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « no previous file | webkit/glue/alt_error_page_resource_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698