Index: content/public/renderer/resource_fetcher.h |
=================================================================== |
--- content/public/renderer/resource_fetcher.h (revision 244609) |
+++ content/public/renderer/resource_fetcher.h (working copy) |
@@ -36,17 +36,26 @@ |
typedef base::Callback<void(const blink::WebURLResponse& response, |
const std::string& data)> Callback; |
- // Creates a ResourceFetcher and starts fetching the specified resource. |
- // Caller takes ownership of the returned object. Deleting the |
- // ResourceFetcher will cancel the request, and the callback will never be |
- // run. |
- static ResourceFetcher* Create(const GURL& url, |
- blink::WebFrame* frame, |
- blink::WebURLRequest::TargetType target_type, |
- const Callback& callback); |
+ // Creates a ResourceFetcher for the specified resource. Caller takes |
+ // ownership of the returned object. Deleting the ResourceFetcher will cancel |
+ // the request, and the callback will never be run. |
+ static ResourceFetcher* Create(const GURL& url); |
+ // Set the corresponding parameters of the request. Must be called before |
+ // Start. By default, requests are GETs with no body. |
+ virtual void SetMethod(const std::string& method) = 0; |
+ virtual void SetBody(const std::string& body) = 0; |
+ virtual void SetHeader(const std::string& header, |
+ const std::string& value) = 0; |
+ |
+ // Starts the request using the specified frame. Calls |callback| when |
+ // done. |
+ virtual void Start(blink::WebFrame* frame, |
+ blink::WebURLRequest::TargetType target_type, |
+ const Callback& callback) = 0; |
+ |
// Sets how long to wait for the server to reply. By default, there is no |
- // timeout. |
+ // timeout. Must be called after a request is started. |
virtual void SetTimeout(const base::TimeDelta& timeout) = 0; |
}; |