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

Unified Diff: webkit/glue/plugins/pepper_url_loader.h

Issue 2861036: Add basic Pepper URLLoader implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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 | « webkit/glue/plugins/pepper_plugin_instance.h ('k') | webkit/glue/plugins/pepper_url_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/pepper_url_loader.h
===================================================================
--- webkit/glue/plugins/pepper_url_loader.h (revision 51226)
+++ webkit/glue/plugins/pepper_url_loader.h (working copy)
@@ -5,9 +5,14 @@
#ifndef WEBKIT_GLUE_PLUGINS_PEPPER_URL_LOADER_H_
#define WEBKIT_GLUE_PLUGINS_PEPPER_URL_LOADER_H_
+#include <deque>
+
+#include "base/scoped_ptr.h"
+#include "third_party/ppapi/c/pp_completion_callback.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebURLLoader.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h"
#include "webkit/glue/plugins/pepper_resource.h"
-typedef struct _pp_CompletionCallback PP_CompletionCallback;
typedef struct _ppb_URLLoader PPB_URLLoader;
namespace pepper {
@@ -16,7 +21,7 @@
class URLRequestInfo;
class URLResponseInfo;
-class URLLoader : public Resource {
+class URLLoader : public Resource, public WebKit::WebURLLoaderClient {
public:
explicit URLLoader(PluginInstance* instance);
virtual ~URLLoader();
@@ -37,7 +42,7 @@
URLResponseInfo* response_info() const { return response_info_; }
- // Progress counters:
+ // Progress counters.
int64_t bytes_sent() const { return bytes_sent_; }
int64_t total_bytes_to_be_sent() const { return total_bytes_to_be_sent_; }
int64_t bytes_received() const { return bytes_received_; }
@@ -46,11 +51,36 @@
}
private:
+ void RunCallback(int32_t result);
+ size_t FillUserBuffer();
+
+ // WebKit::WebURLLoaderClient implementation.
+ virtual void willSendRequest(WebKit::WebURLLoader* loader,
+ WebKit::WebURLRequest& new_request,
+ const WebKit::WebURLResponse& redir_response);
+ virtual void didSendData(WebKit::WebURLLoader* loader,
+ unsigned long long bytes_sent,
+ unsigned long long total_bytes_to_be_sent);
+ virtual void didReceiveResponse(WebKit::WebURLLoader* loader,
+ const WebKit::WebURLResponse& response);
+ virtual void didReceiveData(WebKit::WebURLLoader* loader,
+ const char* data,
+ int data_length);
+ virtual void didFinishLoading(WebKit::WebURLLoader* loader);
+ virtual void didFail(WebKit::WebURLLoader* loader,
+ const WebKit::WebURLError& error);
+
+ scoped_refptr<PluginInstance> instance_;
+ scoped_ptr<WebKit::WebURLLoader> loader_;
scoped_refptr<URLResponseInfo> response_info_;
+ PP_CompletionCallback pending_callback_;
+ std::deque<char> buffer_;
int64_t bytes_sent_;
int64_t total_bytes_to_be_sent_;
int64_t bytes_received_;
int64_t total_bytes_to_be_received_;
+ char* user_buffer_;
+ size_t user_buffer_size_;
};
} // namespace pepper
« no previous file with comments | « webkit/glue/plugins/pepper_plugin_instance.h ('k') | webkit/glue/plugins/pepper_url_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698