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_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 Loading... |
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; | |
128 | 127 |
129 if (instance_.get()) { | 128 if (instance_.get()) { |
130 ppapi::PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(instance_object_); | 129 ppapi::PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(instance_object_); |
131 instance_object_ = PP_MakeUndefined(); | 130 instance_object_ = PP_MakeUndefined(); |
132 instance_->Delete(); | 131 instance_->Delete(); |
133 instance_ = NULL; | 132 instance_ = NULL; |
134 } | 133 } |
135 throttler_.reset(); | |
136 | 134 |
137 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 135 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
138 } | 136 } |
139 | 137 |
140 v8::Local<v8::Object> PepperWebPluginImpl::v8ScriptableObject( | 138 v8::Local<v8::Object> PepperWebPluginImpl::v8ScriptableObject( |
141 v8::Isolate* isolate) { | 139 v8::Isolate* isolate) { |
142 // Call through the plugin to get its instance object. The plugin should pass | 140 // Call through the plugin to get its instance object. The plugin should pass |
143 // us a reference which we release in destroy(). | 141 // us a reference which we release in destroy(). |
144 if (instance_object_.type == PP_VARTYPE_UNDEFINED) | 142 if (instance_object_.type == PP_VARTYPE_UNDEFINED) |
145 instance_object_ = instance_->GetInstanceObject(isolate); | 143 instance_object_ = instance_->GetInstanceObject(isolate); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 288 |
291 bool PepperWebPluginImpl::canRotateView() { return instance_->CanRotateView(); } | 289 bool PepperWebPluginImpl::canRotateView() { return instance_->CanRotateView(); } |
292 | 290 |
293 void PepperWebPluginImpl::rotateView(RotationType type) { | 291 void PepperWebPluginImpl::rotateView(RotationType type) { |
294 instance_->RotateView(type); | 292 instance_->RotateView(type); |
295 } | 293 } |
296 | 294 |
297 bool PepperWebPluginImpl::isPlaceholder() { return false; } | 295 bool PepperWebPluginImpl::isPlaceholder() { return false; } |
298 | 296 |
299 } // namespace content | 297 } // namespace content |
OLD | NEW |