Index: content/renderer/pepper/message_channel.cc |
diff --git a/content/renderer/pepper/message_channel.cc b/content/renderer/pepper/message_channel.cc |
index d5bbef9f0c2a55bb2efdb4b066d700b9d0b31abb..4abbbbe7685753ecb1c8c68871ea036217d076dd 100644 |
--- a/content/renderer/pepper/message_channel.cc |
+++ b/content/renderer/pepper/message_channel.cc |
@@ -96,7 +96,7 @@ MessageChannel* MessageChannel::Create(PepperPluginInstanceImpl* instance, |
v8::Persistent<v8::Object>* result) { |
MessageChannel* message_channel = new MessageChannel(instance); |
v8::HandleScope handle_scope(instance->GetIsolate()); |
- v8::Context::Scope context_scope(instance->GetContext()); |
+ v8::Context::Scope context_scope(instance->GetMainWorldContext()); |
gin::Handle<MessageChannel> handle = |
gin::CreateHandle(instance->GetIsolate(), message_channel); |
result->Reset(instance->GetIsolate(), handle.ToV8()->ToObject()); |
@@ -118,7 +118,7 @@ void MessageChannel::PostMessageToJavaScript(PP_Var message_data) { |
// Because V8 is probably not on the stack for Native->JS calls, we need to |
// enter the appropriate context for the plugin. |
- v8::Local<v8::Context> context = instance_->GetContext(); |
+ v8::Local<v8::Context> context = instance_->GetMainWorldContext(); |
if (context.IsEmpty()) |
return; |