| 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 "webkit/glue/alt_error_page_resource_fetcher.h" | 5 #include "webkit/glue/alt_error_page_resource_fetcher.h" |
| 6 | 6 |
| 7 #include "webkit/glue/resource_fetcher.h" | 7 #include "webkit/glue/resource_fetcher.h" |
| 8 | 8 |
| 9 using WebKit::WebFrame; |
| 9 using WebKit::WebURLError; | 10 using WebKit::WebURLError; |
| 10 using WebKit::WebURLResponse; | 11 using WebKit::WebURLResponse; |
| 11 | 12 |
| 12 namespace webkit_glue { | 13 namespace webkit_glue { |
| 13 | 14 |
| 14 // Number of seconds to wait for the alternate error page server. If it takes | 15 // Number of seconds to wait for the alternate error page server. If it takes |
| 15 // too long, just use the local error page. | 16 // too long, just use the local error page. |
| 16 static const int kDownloadTimeoutSec = 3; | 17 static const int kDownloadTimeoutSec = 3; |
| 17 | 18 |
| 18 AltErrorPageResourceFetcher::AltErrorPageResourceFetcher( | 19 AltErrorPageResourceFetcher::AltErrorPageResourceFetcher( |
| (...skipping 21 matching lines...) Expand all Loading... |
| 40 const std::string& data) { | 41 const std::string& data) { |
| 41 // A null response indicates a network error. | 42 // A null response indicates a network error. |
| 42 if (!response.isNull() && response.httpStatusCode() == 200) { | 43 if (!response.isNull() && response.httpStatusCode() == 200) { |
| 43 callback_->Run(frame_, original_error_, data); | 44 callback_->Run(frame_, original_error_, data); |
| 44 } else { | 45 } else { |
| 45 callback_->Run(frame_, original_error_, std::string()); | 46 callback_->Run(frame_, original_error_, std::string()); |
| 46 } | 47 } |
| 47 } | 48 } |
| 48 | 49 |
| 49 } // namespace webkit_glue | 50 } // namespace webkit_glue |
| OLD | NEW |