| 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 // A wrapper around ResourceHandle and ResourceHandleClient that simplifies | 5 // A wrapper around ResourceHandle and ResourceHandleClient that simplifies |
| 6 // the download of an HTTP object. The interface is modeled after URLFetcher | 6 // the download of an HTTP object. The interface is modeled after URLFetcher |
| 7 // in the /chrome/browser. | 7 // in the /chrome/browser. |
| 8 // | 8 // |
| 9 // ResourceFetcher::Delegate::OnURLFetchComplete will be called async after | 9 // ResourceFetcher::Delegate::OnURLFetchComplete will be called async after |
| 10 // the ResourceFetcher object is created. | 10 // the ResourceFetcher object is created. |
| 11 | 11 |
| 12 #ifndef WEBKIT_GLUE_RESOURCE_FETCHER_H__ | 12 #ifndef WEBKIT_GLUE_RESOURCE_FETCHER_H__ |
| 13 #define WEBKIT_GLUE_RESOURCE_FETCHER_H__ | 13 #define WEBKIT_GLUE_RESOURCE_FETCHER_H__ |
| 14 | 14 |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
| 18 #include "base/scoped_ptr.h" | 18 #include "base/scoped_ptr.h" |
| 19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 20 | 20 |
| 21 #pragma warning(push, 0) | 21 #pragma warning(push, 0) |
| 22 #include "Frame.h" | 22 #include "Frame.h" |
| 23 #include "Timer.h" | 23 #include "Timer.h" |
| 24 #include "ResourceHandleClient.h" | 24 #include "ResourceHandleClient.h" |
| 25 #include "ResourceResponse.h" | 25 #include "ResourceResponse.h" |
| 26 #pragma warning(pop) | 26 #pragma warning(pop) |
| 27 | 27 |
| 28 class GURL; | 28 class GURL; |
| 29 class WebCore::ResourceHandle; | |
| 30 | 29 |
| 31 class ResourceFetcher : public WebCore::ResourceHandleClient { | 30 class ResourceFetcher : public WebCore::ResourceHandleClient { |
| 32 public: | 31 public: |
| 33 class Delegate { | 32 class Delegate { |
| 34 public: | 33 public: |
| 35 // This will be called when the URL has been fetched, successfully or not. | 34 // This will be called when the URL has been fetched, successfully or not. |
| 36 // If there is a failure, response and data will both be empty. | 35 // If there is a failure, response and data will both be empty. |
| 37 // |response| and |data| are both valid until the URLFetcher instance is | 36 // |response| and |data| are both valid until the URLFetcher instance is |
| 38 // destroyed. | 37 // destroyed. |
| 39 virtual void OnURLFetchComplete(const WebCore::ResourceResponse& response, | 38 virtual void OnURLFetchComplete(const WebCore::ResourceResponse& response, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // page server. If this timer fires and the request hasn't completed, we | 108 // page server. If this timer fires and the request hasn't completed, we |
| 110 // kill the request. | 109 // kill the request. |
| 111 void TimeoutFired(FetchTimer* timer); | 110 void TimeoutFired(FetchTimer* timer); |
| 112 | 111 |
| 113 // Limit how long we wait for the alternate error page server. | 112 // Limit how long we wait for the alternate error page server. |
| 114 scoped_ptr<FetchTimer> timeout_timer_; | 113 scoped_ptr<FetchTimer> timeout_timer_; |
| 115 }; | 114 }; |
| 116 | 115 |
| 117 #endif // WEBKIT_GLUE_RESOURCE_FETCHER_H__ | 116 #endif // WEBKIT_GLUE_RESOURCE_FETCHER_H__ |
| 118 | 117 |
| OLD | NEW |