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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 | 656 |
657 v8::Local<v8::Context> context = | 657 v8::Local<v8::Context> context = |
658 container_->element().document().frame()->mainWorldScriptContext(); | 658 container_->element().document().frame()->mainWorldScriptContext(); |
659 DCHECK(context->GetIsolate() == isolate_); | 659 DCHECK(context->GetIsolate() == isolate_); |
660 return context; | 660 return context; |
661 } | 661 } |
662 | 662 |
663 void PepperPluginInstanceImpl::Delete() { | 663 void PepperPluginInstanceImpl::Delete() { |
664 is_deleted_ = true; | 664 is_deleted_ = true; |
665 | 665 |
666 if (render_frame_ && | 666 if (render_frame_ && render_frame_->render_view() && |
667 render_frame_->render_view()->plugin_find_handler() == this) { | 667 render_frame_->render_view()->plugin_find_handler() == this) { |
668 render_frame_->render_view()->set_plugin_find_handler(NULL); | 668 render_frame_->render_view()->set_plugin_find_handler(NULL); |
669 } | 669 } |
670 | 670 |
671 // Keep a reference on the stack. See NOTE above. | 671 // Keep a reference on the stack. See NOTE above. |
672 scoped_refptr<PepperPluginInstanceImpl> ref(this); | 672 scoped_refptr<PepperPluginInstanceImpl> ref(this); |
673 // Force the MessageChannel to release its "passthrough object" which should | 673 // Force the MessageChannel to release its "passthrough object" which should |
674 // release our last reference to the "InstanceObject" and will probably | 674 // release our last reference to the "InstanceObject" and will probably |
675 // destroy it. We want to do this prior to calling DidDestroy in case the | 675 // destroy it. We want to do this prior to calling DidDestroy in case the |
676 // destructor of the instance object tries to use the instance. | 676 // destructor of the instance object tries to use the instance. |
(...skipping 2667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3344 | 3344 |
3345 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { | 3345 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { |
3346 if (initialized_ && !javascript_used_ && is_flash_plugin_) { | 3346 if (initialized_ && !javascript_used_ && is_flash_plugin_) { |
3347 javascript_used_ = true; | 3347 javascript_used_ = true; |
3348 RenderThread::Get()->RecordAction( | 3348 RenderThread::Get()->RecordAction( |
3349 base::UserMetricsAction("Flash.JavaScriptUsed")); | 3349 base::UserMetricsAction("Flash.JavaScriptUsed")); |
3350 } | 3350 } |
3351 } | 3351 } |
3352 | 3352 |
3353 } // namespace content | 3353 } // namespace content |
OLD | NEW |