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

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 1123393004: Check if the RenderView is alive before setting the plugin find handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698