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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 11490014: PPAPI: Make Messaging not PostTask and copy when out-of-process. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years 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/plugins/ppapi/plugin_module.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.cc b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
index 1bc047761bc95f9757473cc5b9bf90bfa78e4a79..64cdb5a116e3339c50330b34467efe3480bbe67a 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.cc
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.cc
@@ -580,10 +580,13 @@ bool PluginInstance::Initialize(const std::vector<std::string>& arg_names,
argv_ = arg_values;
scoped_array<const char*> argn_array(StringVectorToArgArray(argn_));
scoped_array<const char*> argv_array(StringVectorToArgArray(argv_));
- return PP_ToBool(instance_interface_->DidCreate(pp_instance(),
- argn_.size(),
- argn_array.get(),
- argv_array.get()));
+ bool success = PP_ToBool(instance_interface_->DidCreate(pp_instance(),
+ argn_.size(),
+ argn_array.get(),
+ argv_array.get()));
+ if (success)
+ message_channel_->StopQueueingJavaScriptMessages();
+ return success;
}
bool PluginInstance::HandleDocumentLoad(PPB_URLLoader_Impl* loader) {
@@ -2386,6 +2389,9 @@ bool PluginInstance::ResetAsProxied(scoped_refptr<PluginModule> module) {
original_module_ = module_;
module_ = module;
+ // Don't send any messages to the plugin until DidCreate() has finished.
+ message_channel_->QueueJavaScriptMessages();
+
// For NaCl instances, remember the NaCl plugin instance interface, so we
// can shut it down by calling its DidDestroy in our Delete() method.
original_instance_interface_.reset(instance_interface_.release());
@@ -2420,6 +2426,7 @@ bool PluginInstance::ResetAsProxied(scoped_refptr<PluginModule> module) {
if (!instance_interface_->DidCreate(pp_instance(), argn_.size(),
argn_array.get(), argv_array.get()))
return false;
+ message_channel_->StopQueueingJavaScriptMessages();
// Clear sent_initial_did_change_view_ and cancel any pending DidChangeView
// event. This way, SendDidChangeView will send the "current" view
« no previous file with comments | « webkit/plugins/ppapi/plugin_module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698