| 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 "DocumentLoader.h" | 10 #include "DocumentLoader.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 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 |
| OLD | NEW |