diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-11 16:17:39 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-11 16:17:39 +0000 |
commit | c1a94438912c653a9f773445bd09f5536d79bec4 (patch) | |
tree | bddba36e083fa5f971b1886a3daa56ba3446e577 /webkit | |
parent | b5cad5e6217746d2cc10ebebe0f44fe2be7225fc (diff) | |
download | chromium_src-c1a94438912c653a9f773445bd09f5536d79bec4.zip chromium_src-c1a94438912c653a9f773445bd09f5536d79bec4.tar.gz chromium_src-c1a94438912c653a9f773445bd09f5536d79bec4.tar.bz2 |
Remove an NPP_SetWindow call left over from the old Carbon idle event code
Also moves DestroyInstance() into ~WebPluginDelegateImple, to match the other platforms, and unforks the now-similar PluginDestroyed (only Windows currently changes handle_event_depth_, so the behavior for Mac and Linux will be unchanged).
BUG=35074
TEST=Covered by existing plugin tests.
Review URL: http://codereview.chromium.org/604009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38775 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
4 files changed, 13 insertions, 34 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/glue/plugins/webplugin_delegate_impl.cc index d2ecbc7..1b033f6 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl.cc @@ -47,6 +47,14 @@ WebPluginDelegateImpl* WebPluginDelegateImpl::Create( return new WebPluginDelegateImpl(containing_view, instance.get()); } +void WebPluginDelegateImpl::PluginDestroyed() { + if (handle_event_depth_) { + MessageLoop::current()->DeleteSoon(FROM_HERE, this); + } else { + delete this; + } +} + bool WebPluginDelegateImpl::Initialize( const GURL& url, const std::vector<std::string>& arg_names, diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc index 258193c..ab61526 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc @@ -50,7 +50,8 @@ WebPluginDelegateImpl::WebPluginDelegateImpl( plug_(NULL), socket_(NULL), parent_(containing_view), - quirks_(0) { + quirks_(0), + handle_event_depth_(0), { memset(&window_, 0, sizeof(window_)); if (instance_->mime_type() == "application/x-shockwave-flash") { // Flash is tied to Firefox's whacky behavior with windowless plugins. See @@ -94,10 +95,6 @@ void WebPluginDelegateImpl::PlatformDestroyInstance() { // Nothing to do here. } -void WebPluginDelegateImpl::PluginDestroyed() { - delete this; -} - void WebPluginDelegateImpl::Paint(WebKit::WebCanvas* canvas, const gfx::Rect& rect) { if (!windowless_) diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm index 8c9d3d2..014e755 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm @@ -201,6 +201,9 @@ WebPluginDelegateImpl::WebPluginDelegateImpl( WebPluginDelegateImpl::~WebPluginDelegateImpl() { std::set<WebPluginDelegateImpl*>* delegates = g_active_delegates.Pointer(); delegates->erase(this); + + DestroyInstance(); + #ifndef NP_NO_CARBON if (cg_context_.window) { FakePluginWindowTracker::SharedInstance()->RemoveFakeWindowForDelegate( @@ -209,27 +212,6 @@ WebPluginDelegateImpl::~WebPluginDelegateImpl() { #endif } -void WebPluginDelegateImpl::PluginDestroyed() { - if (instance()->event_model() == NPEventModelCarbon) { - if (instance()->drawing_model() == NPDrawingModelQuickDraw) { - // Tell the plugin it should stop drawing into the window (which will go - // away when the next idle event arrives). - window_.x = 0; - window_.y = 0; - window_.width = 0; - window_.height = 0; - window_.clipRect.top = 0; - window_.clipRect.left = 0; - window_.clipRect.bottom = 0; - window_.clipRect.right = 0; - instance()->NPP_SetWindow(&window_); - QDFlushPortBuffer(qd_port_.port, NULL); - } - } - DestroyInstance(); - delete this; -} - void WebPluginDelegateImpl::PlatformInitialize() { // Don't set a NULL window handle on destroy for Mac plugins. This matches // Safari and other Mac browsers (see PluginView::stop() in PluginView.cpp, diff --git a/webkit/glue/plugins/webplugin_delegate_impl_win.cc b/webkit/glue/plugins/webplugin_delegate_impl_win.cc index 7efe7fa..3d19b06 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_win.cc +++ b/webkit/glue/plugins/webplugin_delegate_impl_win.cc @@ -320,14 +320,6 @@ WebPluginDelegateImpl::~WebPluginDelegateImpl() { } } -void WebPluginDelegateImpl::PluginDestroyed() { - if (handle_event_depth_) { - MessageLoop::current()->DeleteSoon(FROM_HERE, this); - } else { - delete this; - } -} - void WebPluginDelegateImpl::PlatformInitialize() { plugin_->SetWindow(windowed_handle_); |