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

Side by Side Diff: webkit/glue/alt_error_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 | « webkit/glue/alt_404_page_resource_fetcher.cc ('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) 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 "ResourceResponse.h" 10 #include "ResourceResponse.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 AltErrorPageResourceFetcher::~AltErrorPageResourceFetcher() { 46 AltErrorPageResourceFetcher::~AltErrorPageResourceFetcher() {
47 } 47 }
48 48
49 void AltErrorPageResourceFetcher::OnURLFetchComplete( 49 void AltErrorPageResourceFetcher::OnURLFetchComplete(
50 const WebURLResponse& response, 50 const WebURLResponse& response,
51 const std::string& data) { 51 const std::string& data) {
52 WebViewDelegate* delegate = web_view_->GetDelegate(); 52 WebViewDelegate* delegate = web_view_->GetDelegate();
53 if (!delegate) 53 if (!delegate)
54 return; 54 return;
55 55
56 if (response.httpStatusCode() == 200) { 56 if (!response.isNull() && response.httpStatusCode() == 200) {
57 // We successfully got a response from the alternate error page server, so 57 // We successfully got a response from the alternate error page server, so
58 // load it. 58 // load it.
59 delegate->LoadNavigationErrorPage(web_frame_, failed_request_, 59 delegate->LoadNavigationErrorPage(web_frame_, failed_request_,
60 web_error_, data, true); 60 web_error_, data, true);
61 } else { 61 } else {
62 delegate->LoadNavigationErrorPage(web_frame_, failed_request_, 62 delegate->LoadNavigationErrorPage(web_frame_, failed_request_,
63 web_error_, std::string(), true); 63 web_error_, std::string(), true);
64 } 64 }
65 } 65 }
66 66
67 } // namespace webkit_glue 67 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/alt_404_page_resource_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698