| 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 #ifndef WEBKIT_GLUE_ALT_ERROR_PAGE_RESOURCE_FETCHER_H__ | 5 #ifndef WEBKIT_GLUE_ALT_ERROR_PAGE_RESOURCE_FETCHER_H__ |
| 6 #define WEBKIT_GLUE_ALT_ERROR_PAGE_RESOURCE_FETCHER_H__ | 6 #define WEBKIT_GLUE_ALT_ERROR_PAGE_RESOURCE_FETCHER_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | |
| 11 | |
| 12 MSVC_PUSH_WARNING_LEVEL(0); | |
| 13 #include "Timer.h" | |
| 14 MSVC_POP_WARNING(); | |
| 15 | |
| 16 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| 17 #include "webkit/api/public/WebURLError.h" | 11 #include "webkit/api/public/WebURLError.h" |
| 18 #include "webkit/api/public/WebURLRequest.h" | 12 #include "webkit/api/public/WebURLRequest.h" |
| 19 #include "webkit/glue/resource_fetcher.h" | 13 #include "webkit/glue/resource_fetcher.h" |
| 20 | 14 |
| 21 class ResourceFetcherWithTimeout; | 15 class ResourceFetcherWithTimeout; |
| 22 class WebFrameImpl; | 16 class WebFrameImpl; |
| 23 class WebView; | 17 class WebView; |
| 24 | 18 |
| 19 namespace webkit_glue { |
| 20 |
| 25 // Used for downloading alternate dns error pages. Once downloading is done | 21 // Used for downloading alternate dns error pages. Once downloading is done |
| 26 // (or fails), the webview delegate is notified. | 22 // (or fails), the webview delegate is notified. |
| 27 class AltErrorPageResourceFetcher : public ResourceFetcher::Delegate { | 23 class AltErrorPageResourceFetcher { |
| 28 public: | 24 public: |
| 29 AltErrorPageResourceFetcher(WebView* web_view, | 25 AltErrorPageResourceFetcher(WebView* web_view, |
| 26 WebFrame* web_frame, |
| 30 const WebKit::WebURLError& web_error, | 27 const WebKit::WebURLError& web_error, |
| 31 WebFrameImpl* web_frame, | |
| 32 const GURL& url); | 28 const GURL& url); |
| 33 ~AltErrorPageResourceFetcher(); | 29 ~AltErrorPageResourceFetcher(); |
| 34 | 30 |
| 35 virtual void OnURLFetchComplete(const WebCore::ResourceResponse& response, | 31 private: |
| 36 const std::string& data); | 32 void OnURLFetchComplete(const WebKit::WebURLResponse& response, |
| 33 const std::string& data); |
| 37 | 34 |
| 38 private: | |
| 39 // References to our owners | 35 // References to our owners |
| 40 WebView* web_view_; | 36 WebView* web_view_; |
| 37 WebFrame* web_frame_; |
| 41 WebKit::WebURLError web_error_; | 38 WebKit::WebURLError web_error_; |
| 42 WebFrameImpl* web_frame_; | |
| 43 WebKit::WebURLRequest failed_request_; | 39 WebKit::WebURLRequest failed_request_; |
| 44 | 40 |
| 45 // Does the actual fetching. | 41 // Does the actual fetching. |
| 46 scoped_ptr<ResourceFetcherWithTimeout> fetcher_; | 42 scoped_ptr<ResourceFetcherWithTimeout> fetcher_; |
| 47 | 43 |
| 48 DISALLOW_COPY_AND_ASSIGN(AltErrorPageResourceFetcher); | 44 DISALLOW_COPY_AND_ASSIGN(AltErrorPageResourceFetcher); |
| 49 }; | 45 }; |
| 50 | 46 |
| 47 } // namespace webkit_glue |
| 48 |
| 51 #endif // WEBKIT_GLUE_ALT_ERROR_PAGE_RESOURCE_FETCHER_H__ | 49 #endif // WEBKIT_GLUE_ALT_ERROR_PAGE_RESOURCE_FETCHER_H__ |
| OLD | NEW |