Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: content/public/renderer/resource_fetcher.h

Issue 140823010: ResourceFetcher: Add POST support and the ability to set headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Gack Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/net/net_error_helper.cc ('k') | content/renderer/fetchers/image_resource_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « chrome/renderer/net/net_error_helper.cc ('k') | content/renderer/fetchers/image_resource_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698