| 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. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 virtual void didFinishLoading(WebKit::WebURLLoader* loader); | 65 virtual void didFinishLoading(WebKit::WebURLLoader* loader); |
| 66 virtual void didFail( | 66 virtual void didFail( |
| 67 WebKit::WebURLLoader* loader, const WebKit::WebURLError& error); | 67 WebKit::WebURLLoader* loader, const WebKit::WebURLError& error); |
| 68 | 68 |
| 69 scoped_ptr<WebKit::WebURLLoader> loader_; | 69 scoped_ptr<WebKit::WebURLLoader> loader_; |
| 70 | 70 |
| 71 // URL we're fetching | 71 // URL we're fetching |
| 72 GURL url_; | 72 GURL url_; |
| 73 | 73 |
| 74 // Callback when we're done | 74 // Callback when we're done |
| 75 Callback* callback_; | 75 scoped_ptr<Callback> callback_; |
| 76 | 76 |
| 77 // A copy of the original resource response | 77 // A copy of the original resource response |
| 78 WebKit::WebURLResponse response_; | 78 WebKit::WebURLResponse response_; |
| 79 | 79 |
| 80 // Set to true once the request is compelte. | 80 // Set to true once the request is compelte. |
| 81 bool completed_; | 81 bool completed_; |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 // Start the actual download. | 84 // Start the actual download. |
| 85 void Start(WebFrame* frame); | 85 void Start(WebFrame* frame); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 102 // kill the request. | 102 // kill the request. |
| 103 void TimeoutFired(); | 103 void TimeoutFired(); |
| 104 | 104 |
| 105 // Limit how long we wait for the alternate error page server. | 105 // Limit how long we wait for the alternate error page server. |
| 106 base::OneShotTimer<ResourceFetcherWithTimeout> timeout_timer_; | 106 base::OneShotTimer<ResourceFetcherWithTimeout> timeout_timer_; |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 } // namespace webkit_glue | 109 } // namespace webkit_glue |
| 110 | 110 |
| 111 #endif // WEBKIT_GLUE_RESOURCE_FETCHER_H_ | 111 #endif // WEBKIT_GLUE_RESOURCE_FETCHER_H_ |
| OLD | NEW |