diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-12 21:24:24 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-12 21:24:24 +0000 |
commit | 48a5faa6500b6c6055348abf1540cbb06c721f33 (patch) | |
tree | 043ab3baeec17a93ee2bcee1c23e92f3d608a4e9 /ppapi/proxy/ppb_font_proxy.cc | |
parent | b7a4f36aa4ac90259978a7bdf83288e6889fbc83 (diff) | |
download | chromium_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_font_proxy.cc')
-rw-r--r-- | ppapi/proxy/ppb_font_proxy.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ppapi/proxy/ppb_font_proxy.cc b/ppapi/proxy/ppb_font_proxy.cc index 2313c34..4f10956 100644 --- a/ppapi/proxy/ppb_font_proxy.cc +++ b/ppapi/proxy/ppb_font_proxy.cc @@ -246,18 +246,24 @@ void PPB_Font_Proxy::OnMsgCreate( in_desc.letter_spacing = in_description.letter_spacing; in_desc.word_spacing = in_description.word_spacing; + PP_FontDescription_Dev out_desc; + SerializedVarOutParam out_face_name(&out_description->face); + *result = ppb_font_target()->Create(pp_module, &in_desc); - if (!*result) + if (!*result) { + // Even in the failure case we need to set the var for the name or it + // will have no dispatcher set, and the serialization layer will assert + // when we're sending it to the browser. + *out_face_name.OutParam(dispatcher()) = PP_MakeUndefined(); return; + } // Get the metrics and resulting description to return to the browser. - PP_FontDescription_Dev out_desc; PP_FontMetrics_Dev metrics; ppb_font_target()->Describe(*result, &out_desc, &metrics); // Convert the PP_Var in the resulting description to an out param. This // should clean up the ref |Describe| assigned to our font name. - SerializedVarOutParam out_face_name(&out_description->face); *out_face_name.OutParam(dispatcher()) = out_desc.face; // The rest of the font description is easy. |