| 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 "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 | 346 |
| 347 // NOTE: Any of these methods that calls into the plugin needs to take into | 347 // NOTE: Any of these methods that calls into the plugin needs to take into |
| 348 // account that the plugin may use Var to remove the <embed> from the DOM, which | 348 // account that the plugin may use Var to remove the <embed> from the DOM, which |
| 349 // will make the WebPluginImpl drop its reference, usually the last one. If a | 349 // will make the WebPluginImpl drop its reference, usually the last one. If a |
| 350 // method needs to access a member of the instance after the call has returned, | 350 // method needs to access a member of the instance after the call has returned, |
| 351 // then it needs to keep its own reference on the stack. | 351 // then it needs to keep its own reference on the stack. |
| 352 | 352 |
| 353 void PluginInstance::Delete() { | 353 void PluginInstance::Delete() { |
| 354 // Keep a reference on the stack. See NOTE above. | 354 // Keep a reference on the stack. See NOTE above. |
| 355 scoped_refptr<PluginInstance> ref(this); | 355 scoped_refptr<PluginInstance> ref(this); |
| 356 // Force the MessageChannel to release its "passthrough object" which should |
| 357 // release our last reference to the "InstanceObject" and will probably |
| 358 // destroy it. We want to do this prior to calling DidDestroy in case the |
| 359 // destructor of the instance object tries to use the instance. |
| 360 message_channel_->SetPassthroughObject(NULL); |
| 356 instance_interface_->DidDestroy(pp_instance()); | 361 instance_interface_->DidDestroy(pp_instance()); |
| 357 | 362 |
| 358 if (fullscreen_container_) { | 363 if (fullscreen_container_) { |
| 359 fullscreen_container_->Destroy(); | 364 fullscreen_container_->Destroy(); |
| 360 fullscreen_container_ = NULL; | 365 fullscreen_container_ = NULL; |
| 361 } | 366 } |
| 362 container_ = NULL; | 367 container_ = NULL; |
| 363 } | 368 } |
| 364 | 369 |
| 365 void PluginInstance::Paint(WebCanvas* canvas, | 370 void PluginInstance::Paint(WebCanvas* canvas, |
| (...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2119 screen_size_for_fullscreen_ = gfx::Size(); | 2124 screen_size_for_fullscreen_ = gfx::Size(); |
| 2120 WebElement element = container_->element(); | 2125 WebElement element = container_->element(); |
| 2121 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2126 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
| 2122 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2127 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
| 2123 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2128 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
| 2124 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2129 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
| 2125 } | 2130 } |
| 2126 | 2131 |
| 2127 } // namespace ppapi | 2132 } // namespace ppapi |
| 2128 } // namespace webkit | 2133 } // namespace webkit |
| OLD | NEW |