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

Side by Side Diff: Source/core/html/HTMLPlugInElement.cpp

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase upto and resolve r182737 conflict. Created 6 years, 2 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
OLDNEW
1 /** 1 /**
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 , m_usePlaceholderContent(false) 70 , m_usePlaceholderContent(false)
71 { 71 {
72 setHasCustomStyleCallbacks(); 72 setHasCustomStyleCallbacks();
73 } 73 }
74 74
75 HTMLPlugInElement::~HTMLPlugInElement() 75 HTMLPlugInElement::~HTMLPlugInElement()
76 { 76 {
77 ASSERT(!m_pluginWrapper); // cleared in detach() 77 ASSERT(!m_pluginWrapper); // cleared in detach()
78 ASSERT(!m_isDelayingLoadEvent); 78 ASSERT(!m_isDelayingLoadEvent);
79 79
80 #if ENABLE(OILPAN)
81 if (m_persistedPluginWidget)
82 HTMLFrameOwnerElement::disposeWidget(m_persistedPluginWidget.get());
83 #endif
84
80 if (m_NPObject) { 85 if (m_NPObject) {
81 _NPN_ReleaseObject(m_NPObject); 86 _NPN_ReleaseObject(m_NPObject);
82 m_NPObject = 0; 87 m_NPObject = 0;
83 } 88 }
84 } 89 }
85 90
86 void HTMLPlugInElement::trace(Visitor* visitor) 91 void HTMLPlugInElement::trace(Visitor* visitor)
87 { 92 {
88 visitor->trace(m_imageLoader); 93 visitor->trace(m_imageLoader);
94 visitor->trace(m_persistedPluginWidget);
89 HTMLFrameOwnerElement::trace(visitor); 95 HTMLFrameOwnerElement::trace(visitor);
90 } 96 }
91 97
98 #if ENABLE(OILPAN)
99 void HTMLPlugInElement::disconnectContentFrame()
100 {
101 if (m_persistedPluginWidget)
102 HTMLFrameOwnerElement::disposeWidget(m_persistedPluginWidget.get());
103 HTMLFrameOwnerElement::disconnectContentFrame();
104 }
105 #endif
106
92 bool HTMLPlugInElement::canProcessDrag() const 107 bool HTMLPlugInElement::canProcessDrag() const
93 { 108 {
94 return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(plug inWidget())->canProcessDrag(); 109 return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(plug inWidget())->canProcessDrag();
95 } 110 }
96 111
97 bool HTMLPlugInElement::willRespondToMouseClickEvents() 112 bool HTMLPlugInElement::willRespondToMouseClickEvents()
98 { 113 {
99 if (isDisabledFormControl()) 114 if (isDisabledFormControl())
100 return false; 115 return false;
101 RenderObject* r = renderer(); 116 RenderObject* r = renderer();
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 // FIXME: Mouse down and scroll events are passed down to plug-in via custom 350 // FIXME: Mouse down and scroll events are passed down to plug-in via custom
336 // code in EventHandler; these code paths should be united. 351 // code in EventHandler; these code paths should be united.
337 352
338 RenderObject* r = renderer(); 353 RenderObject* r = renderer();
339 if (!r || !r->isWidget()) 354 if (!r || !r->isWidget())
340 return; 355 return;
341 if (r->isEmbeddedObject()) { 356 if (r->isEmbeddedObject()) {
342 if (toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator()) 357 if (toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator())
343 return; 358 return;
344 } 359 }
345 RefPtr<Widget> widget = toRenderWidget(r)->widget(); 360 RefPtrWillBeRawPtr<Widget> widget = toRenderWidget(r)->widget();
346 if (!widget) 361 if (!widget)
347 return; 362 return;
348 widget->handleEvent(event); 363 widget->handleEvent(event);
349 if (event->defaultHandled()) 364 if (event->defaultHandled())
350 return; 365 return;
351 HTMLFrameOwnerElement::defaultEventHandler(event); 366 HTMLFrameOwnerElement::defaultEventHandler(event);
352 } 367 }
353 368
354 RenderWidget* HTMLPlugInElement::renderWidgetForJSBindings() const 369 RenderWidget* HTMLPlugInElement::renderWidgetForJSBindings() const
355 { 370 {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 490
476 RenderEmbeddedObject* renderer = renderEmbeddedObject(); 491 RenderEmbeddedObject* renderer = renderEmbeddedObject();
477 // FIXME: This code should not depend on renderer! 492 // FIXME: This code should not depend on renderer!
478 if ((!renderer && requireRenderer) || useFallback) 493 if ((!renderer && requireRenderer) || useFallback)
479 return false; 494 return false;
480 495
481 WTF_LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data()); 496 WTF_LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data());
482 WTF_LOG(Plugins, " Loaded URL: %s", url.string().utf8().data()); 497 WTF_LOG(Plugins, " Loaded URL: %s", url.string().utf8().data());
483 m_loadedUrl = url; 498 m_loadedUrl = url;
484 499
485 RefPtr<Widget> widget = m_persistedPluginWidget; 500 RefPtrWillBeRawPtr<Widget> widget = m_persistedPluginWidget;
486 if (!widget) { 501 if (!widget) {
487 bool loadManually = document().isPluginDocument() && !document().contain sPlugins(); 502 bool loadManually = document().isPluginDocument() && !document().contain sPlugins();
488 FrameLoaderClient::DetachedPluginPolicy policy = requireRenderer ? Frame LoaderClient::FailOnDetachedPlugin : FrameLoaderClient::AllowDetachedPlugin; 503 FrameLoaderClient::DetachedPluginPolicy policy = requireRenderer ? Frame LoaderClient::FailOnDetachedPlugin : FrameLoaderClient::AllowDetachedPlugin;
489 widget = frame->loader().client()->createPlugin(this, url, paramNames, p aramValues, mimeType, loadManually, policy); 504 widget = frame->loader().client()->createPlugin(this, url, paramNames, p aramValues, mimeType, loadManually, policy);
490 } 505 }
491 506
492 if (!widget) { 507 if (!widget) {
493 if (renderer && !renderer->showsUnavailablePluginIndicator()) 508 if (renderer && !renderer->showsUnavailablePluginIndicator())
494 renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::Plugin Missing); 509 renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::Plugin Missing);
495 return false; 510 return false;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 601
587 void HTMLPlugInElement::setUsePlaceholderContent(bool use) 602 void HTMLPlugInElement::setUsePlaceholderContent(bool use)
588 { 603 {
589 if (use != m_usePlaceholderContent) { 604 if (use != m_usePlaceholderContent) {
590 m_usePlaceholderContent = use; 605 m_usePlaceholderContent = use;
591 lazyReattachIfAttached(); 606 lazyReattachIfAttached();
592 } 607 }
593 } 608 }
594 609
595 } 610 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698