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

Unified Diff: content/renderer/pepper/message_channel.cc

Issue 331593002: Change V8VarConverter::FromV8Value to complete synchronously if possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « no previous file | content/renderer/pepper/resource_converter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/message_channel.cc
diff --git a/content/renderer/pepper/message_channel.cc b/content/renderer/pepper/message_channel.cc
index 12d24baeda28d561f18ca7ce2ff2285f34b6b880..ebacc632aee96e6d8c99b5eb8670d371e84612b7 100644
--- a/content/renderer/pepper/message_channel.cc
+++ b/content/renderer/pepper/message_channel.cc
@@ -294,12 +294,18 @@ void MessageChannel::EnqueuePluginMessage(const NPVariant* variant) {
// won't result in a deep copy.
v8::Handle<v8::Value> v8_value = WebBindings::toV8Value(variant);
V8VarConverter v8_var_converter(instance_->pp_instance());
- v8_var_converter.FromV8Value(
- v8_value,
- v8::Isolate::GetCurrent()->GetCurrentContext(),
- base::Bind(&MessageChannel::FromV8ValueComplete,
- weak_ptr_factory_.GetWeakPtr(),
- &plugin_message_queue_.back()));
+ V8VarConverter::VarConversionResult conversion_result =
dmichael (off chromium) 2014/06/13 17:24:48 Being nested, maybe it would be enough to call it
raymes 2014/06/16 02:59:25 Done. Well caught - I didn't notice the local clas
+ v8_var_converter.FromV8Value(
+ v8_value,
+ v8::Isolate::GetCurrent()->GetCurrentContext(),
+ base::Bind(&MessageChannel::FromV8ValueComplete,
+ weak_ptr_factory_.GetWeakPtr(),
+ &plugin_message_queue_.back()));
+ if (conversion_result.completed_synchronously) {
+ plugin_message_queue_.back().ConversionCompleted(
+ conversion_result.var,
+ conversion_result.success);
+ }
} else {
plugin_message_queue_.back().ConversionCompleted(
ScopedPPVar(ScopedPPVar::PassRef(),
« no previous file with comments | « no previous file | content/renderer/pepper/resource_converter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698