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

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

Issue 1137663006: Fix WebViewPlugin::scheduleAnimation crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reset throttler_ in PepperPluginInstanceImpl 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 | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | 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_webplugin_impl.h" 5 #include "content/renderer/pepper/pepper_webplugin_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/debug/crash_logging.h" 9 #include "base/debug/crash_logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 init_data_.reset(); 118 init_data_.reset();
119 container_ = container; 119 container_ = container;
120 return true; 120 return true;
121 } 121 }
122 122
123 void PepperWebPluginImpl::destroy() { 123 void PepperWebPluginImpl::destroy() {
124 // Tell |container_| to clear references to this plugin's script objects. 124 // Tell |container_| to clear references to this plugin's script objects.
125 if (container_) 125 if (container_)
126 container_->clearScriptObjects(); 126 container_->clearScriptObjects();
127 container_ = nullptr;
raymes 2015/05/12 00:36:30 I'm not sure that this will actually have any impa
trchen 2015/05/12 01:35:33 Yes I think you're right. Accessing a destroyed pl
127 128
128 if (instance_.get()) { 129 if (instance_.get()) {
129 ppapi::PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(instance_object_); 130 ppapi::PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(instance_object_);
130 instance_object_ = PP_MakeUndefined(); 131 instance_object_ = PP_MakeUndefined();
131 instance_->Delete(); 132 instance_->Delete();
132 instance_ = NULL; 133 instance_ = NULL;
133 } 134 }
135 throttler_.reset();
134 136
135 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); 137 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
136 } 138 }
137 139
138 v8::Local<v8::Object> PepperWebPluginImpl::v8ScriptableObject( 140 v8::Local<v8::Object> PepperWebPluginImpl::v8ScriptableObject(
139 v8::Isolate* isolate) { 141 v8::Isolate* isolate) {
140 // Call through the plugin to get its instance object. The plugin should pass 142 // Call through the plugin to get its instance object. The plugin should pass
141 // us a reference which we release in destroy(). 143 // us a reference which we release in destroy().
142 if (instance_object_.type == PP_VARTYPE_UNDEFINED) 144 if (instance_object_.type == PP_VARTYPE_UNDEFINED)
143 instance_object_ = instance_->GetInstanceObject(isolate); 145 instance_object_ = instance_->GetInstanceObject(isolate);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 290
289 bool PepperWebPluginImpl::canRotateView() { return instance_->CanRotateView(); } 291 bool PepperWebPluginImpl::canRotateView() { return instance_->CanRotateView(); }
290 292
291 void PepperWebPluginImpl::rotateView(RotationType type) { 293 void PepperWebPluginImpl::rotateView(RotationType type) {
292 instance_->RotateView(type); 294 instance_->RotateView(type);
293 } 295 }
294 296
295 bool PepperWebPluginImpl::isPlaceholder() { return false; } 297 bool PepperWebPluginImpl::isPlaceholder() { return false; }
296 298
297 } // namespace content 299 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698