| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 | 665 |
| 666 v8::Local<v8::Object> PepperPluginInstanceImpl::GetMessageChannelObject() { | 666 v8::Local<v8::Object> PepperPluginInstanceImpl::GetMessageChannelObject() { |
| 667 return v8::Local<v8::Object>::New(isolate_, message_channel_object_); | 667 return v8::Local<v8::Object>::New(isolate_, message_channel_object_); |
| 668 } | 668 } |
| 669 | 669 |
| 670 void PepperPluginInstanceImpl::MessageChannelDestroyed() { | 670 void PepperPluginInstanceImpl::MessageChannelDestroyed() { |
| 671 message_channel_ = NULL; | 671 message_channel_ = NULL; |
| 672 message_channel_object_.Reset(); | 672 message_channel_object_.Reset(); |
| 673 } | 673 } |
| 674 | 674 |
| 675 v8::Local<v8::Context> PepperPluginInstanceImpl::GetContext() { | 675 v8::Local<v8::Context> PepperPluginInstanceImpl::GetMainWorldContext() { |
| 676 if (!container_ || | 676 if (!container_) |
| 677 container_->element().isNull() || | |
| 678 container_->element().document().isNull() || | |
| 679 !container_->element().document().frame()) { | |
| 680 return v8::Handle<v8::Context>(); | 677 return v8::Handle<v8::Context>(); |
| 681 } | 678 |
| 679 if (container_->element().isNull()) |
| 680 return v8::Handle<v8::Context>(); |
| 681 |
| 682 if (container_->element().document().isNull()) |
| 683 return v8::Handle<v8::Context>(); |
| 684 |
| 685 if (!container_->element().document().frame()) |
| 686 return v8::Handle<v8::Context>(); |
| 682 | 687 |
| 683 v8::Local<v8::Context> context = | 688 v8::Local<v8::Context> context = |
| 684 container_->element().document().frame()->mainWorldScriptContext(); | 689 container_->element().document().frame()->mainWorldScriptContext(); |
| 685 DCHECK(context->GetIsolate() == isolate_); | 690 DCHECK(context->GetIsolate() == isolate_); |
| 686 return context; | 691 return context; |
| 687 } | 692 } |
| 688 | 693 |
| 689 void PepperPluginInstanceImpl::Delete() { | 694 void PepperPluginInstanceImpl::Delete() { |
| 690 is_deleted_ = true; | 695 is_deleted_ = true; |
| 691 | 696 |
| (...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3383 // Running out-of-process. Initiate an IPC call to notify the plugin | 3388 // Running out-of-process. Initiate an IPC call to notify the plugin |
| 3384 // process. | 3389 // process. |
| 3385 ppapi::proxy::HostDispatcher* dispatcher = | 3390 ppapi::proxy::HostDispatcher* dispatcher = |
| 3386 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); | 3391 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); |
| 3387 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( | 3392 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( |
| 3388 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); | 3393 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); |
| 3389 } | 3394 } |
| 3390 } | 3395 } |
| 3391 | 3396 |
| 3392 } // namespace content | 3397 } // namespace content |
| OLD | NEW |