summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_graphics_2d_proxy.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 21:24:24 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 21:24:24 +0000
commit48a5faa6500b6c6055348abf1540cbb06c721f33 (patch)
tree043ab3baeec17a93ee2bcee1c23e92f3d608a4e9 /ppapi/proxy/ppb_graphics_2d_proxy.h
parentb7a4f36aa4ac90259978a7bdf83288e6889fbc83 (diff)
downloadchromium_src-48a5faa6500b6c6055348abf1540cbb06c721f33.zip
chromium_src-48a5faa6500b6c6055348abf1540cbb06c721f33.tar.gz
chromium_src-48a5faa6500b6c6055348abf1540cbb06c721f33.tar.bz2
Make the Graphics2D flush call an asynchronous operation. This tracks the
callback in the plugin and adds a new message when a flush is complete in the renderer. I adapted the callback factory so it could be used for tracking the flush callbacks in the proxy in the renderer, and also changed the URL loader stuff (which had some custom management) around so that it also uses the factory. This also fixes a bug in font proxying where we would assert if there was a font creation error because the dispatcher wasn't set on the SerializedVar in the font decription. TEST=none BUG=none Review URL: http://codereview.chromium.org/4876003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65995 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_graphics_2d_proxy.h')
-rw-r--r--ppapi/proxy/ppb_graphics_2d_proxy.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/ppapi/proxy/ppb_graphics_2d_proxy.h b/ppapi/proxy/ppb_graphics_2d_proxy.h
index db678eb..66226b9 100644
--- a/ppapi/proxy/ppb_graphics_2d_proxy.h
+++ b/ppapi/proxy/ppb_graphics_2d_proxy.h
@@ -12,7 +12,9 @@
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_size.h"
#include "ppapi/c/pp_var.h"
+#include "ppapi/cpp/completion_callback.h"
#include "ppapi/proxy/interface_proxy.h"
+#include "ppapi/proxy/proxy_non_thread_safe_ref_count.h"
struct PPB_Graphics2D;
struct PP_Point;
@@ -36,7 +38,7 @@ class PPB_Graphics2D_Proxy : public InterfaceProxy {
virtual void OnMessageReceived(const IPC::Message& msg);
private:
- // Message handlers.
+ // Plugin->renderer message handlers.
void OnMsgCreate(PP_Module module,
const PP_Size& size,
PP_Bool is_always_opaque,
@@ -52,9 +54,16 @@ class PPB_Graphics2D_Proxy : public InterfaceProxy {
const PP_Point& amount);
void OnMsgReplaceContents(PP_Resource graphics_2d,
PP_Resource image_data);
- void OnMsgFlush(PP_Resource graphics_2d,
- uint32_t serialized_callback,
- int32_t* result);
+ void OnMsgFlush(PP_Resource graphics_2d);
+
+ // Renderer->plugin message handlers.
+ void OnMsgFlushACK(PP_Resource graphics_2d, int32_t pp_error);
+
+ // Called in the renderer to send the given flush ACK to the plugin.
+ void SendFlushACKToPlugin(int32_t result, PP_Resource graphics_2d);
+
+ CompletionCallbackFactory<PPB_Graphics2D_Proxy,
+ ProxyNonThreadSafeRefCount> callback_factory_;
};
} // namespace proxy