| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |