 Chromium Code Reviews
 Chromium Code Reviews Issue 603193005:
  Move the Widget hierarchy to the Oilpan heap.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 603193005:
  Move the Widget hierarchy to the Oilpan heap.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| OLD | NEW | 
|---|---|
| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 , m_usePlaceholderContent(false) | 71 , m_usePlaceholderContent(false) | 
| 72 { | 72 { | 
| 73 setHasCustomStyleCallbacks(); | 73 setHasCustomStyleCallbacks(); | 
| 74 } | 74 } | 
| 75 | 75 | 
| 76 HTMLPlugInElement::~HTMLPlugInElement() | 76 HTMLPlugInElement::~HTMLPlugInElement() | 
| 77 { | 77 { | 
| 78 ASSERT(!m_pluginWrapper); // cleared in detach() | 78 ASSERT(!m_pluginWrapper); // cleared in detach() | 
| 79 ASSERT(!m_isDelayingLoadEvent); | 79 ASSERT(!m_isDelayingLoadEvent); | 
| 80 | 80 | 
| 81 #if ENABLE(OILPAN) | |
| 82 if (m_persistedPluginWidget) | |
| 83 HTMLFrameOwnerElement::disposeWidget(m_persistedPluginWidget.get()); | |
| 
haraken
2014/09/29 14:16:36
Can't we call HTMLFrameOwnerElement::disposeWidget
 
sof
2014/10/07 13:27:32
That the plugin element isn't in the tree to start
 | |
| 84 #endif | |
| 85 | |
| 81 if (m_NPObject) { | 86 if (m_NPObject) { | 
| 82 _NPN_ReleaseObject(m_NPObject); | 87 _NPN_ReleaseObject(m_NPObject); | 
| 83 m_NPObject = 0; | 88 m_NPObject = 0; | 
| 84 } | 89 } | 
| 85 } | 90 } | 
| 86 | 91 | 
| 87 void HTMLPlugInElement::trace(Visitor* visitor) | 92 void HTMLPlugInElement::trace(Visitor* visitor) | 
| 88 { | 93 { | 
| 89 visitor->trace(m_imageLoader); | 94 visitor->trace(m_imageLoader); | 
| 95 visitor->trace(m_persistedPluginWidget); | |
| 90 HTMLFrameOwnerElement::trace(visitor); | 96 HTMLFrameOwnerElement::trace(visitor); | 
| 91 } | 97 } | 
| 92 | 98 | 
| 99 #if ENABLE(OILPAN) | |
| 100 void HTMLPlugInElement::disconnectContentFrame() | |
| 101 { | |
| 102 if (m_persistedPluginWidget) | |
| 103 HTMLFrameOwnerElement::disposeWidget(m_persistedPluginWidget.get()); | |
| 104 HTMLFrameOwnerElement::disconnectContentFrame(); | |
| 105 } | |
| 106 #endif | |
| 107 | |
| 93 bool HTMLPlugInElement::canProcessDrag() const | 108 bool HTMLPlugInElement::canProcessDrag() const | 
| 94 { | 109 { | 
| 95 return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(plug inWidget())->canProcessDrag(); | 110 return pluginWidget() && pluginWidget()->isPluginView() && toPluginView(plug inWidget())->canProcessDrag(); | 
| 96 } | 111 } | 
| 97 | 112 | 
| 98 bool HTMLPlugInElement::willRespondToMouseClickEvents() | 113 bool HTMLPlugInElement::willRespondToMouseClickEvents() | 
| 99 { | 114 { | 
| 100 if (isDisabledFormControl()) | 115 if (isDisabledFormControl()) | 
| 101 return false; | 116 return false; | 
| 102 RenderObject* r = renderer(); | 117 RenderObject* r = renderer(); | 
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 // FIXME: Mouse down and scroll events are passed down to plug-in via custom | 351 // FIXME: Mouse down and scroll events are passed down to plug-in via custom | 
| 337 // code in EventHandler; these code paths should be united. | 352 // code in EventHandler; these code paths should be united. | 
| 338 | 353 | 
| 339 RenderObject* r = renderer(); | 354 RenderObject* r = renderer(); | 
| 340 if (!r || !r->isWidget()) | 355 if (!r || !r->isWidget()) | 
| 341 return; | 356 return; | 
| 342 if (r->isEmbeddedObject()) { | 357 if (r->isEmbeddedObject()) { | 
| 343 if (toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator()) | 358 if (toRenderEmbeddedObject(r)->showsUnavailablePluginIndicator()) | 
| 344 return; | 359 return; | 
| 345 } | 360 } | 
| 346 RefPtr<Widget> widget = toRenderWidget(r)->widget(); | 361 RefPtrWillBeRawPtr<Widget> widget = toRenderWidget(r)->widget(); | 
| 347 if (!widget) | 362 if (!widget) | 
| 348 return; | 363 return; | 
| 349 widget->handleEvent(event); | 364 widget->handleEvent(event); | 
| 350 if (event->defaultHandled()) | 365 if (event->defaultHandled()) | 
| 351 return; | 366 return; | 
| 352 HTMLFrameOwnerElement::defaultEventHandler(event); | 367 HTMLFrameOwnerElement::defaultEventHandler(event); | 
| 353 } | 368 } | 
| 354 | 369 | 
| 355 RenderWidget* HTMLPlugInElement::renderWidgetForJSBindings() const | 370 RenderWidget* HTMLPlugInElement::renderWidgetForJSBindings() const | 
| 356 { | 371 { | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 476 | 491 | 
| 477 RenderEmbeddedObject* renderer = renderEmbeddedObject(); | 492 RenderEmbeddedObject* renderer = renderEmbeddedObject(); | 
| 478 // FIXME: This code should not depend on renderer! | 493 // FIXME: This code should not depend on renderer! | 
| 479 if ((!renderer && requireRenderer) || useFallback) | 494 if ((!renderer && requireRenderer) || useFallback) | 
| 480 return false; | 495 return false; | 
| 481 | 496 | 
| 482 WTF_LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data()); | 497 WTF_LOG(Plugins, "%p Plug-in URL: %s", this, m_url.utf8().data()); | 
| 483 WTF_LOG(Plugins, " Loaded URL: %s", url.string().utf8().data()); | 498 WTF_LOG(Plugins, " Loaded URL: %s", url.string().utf8().data()); | 
| 484 m_loadedUrl = url; | 499 m_loadedUrl = url; | 
| 485 | 500 | 
| 486 RefPtr<Widget> widget = m_persistedPluginWidget; | 501 RefPtrWillBeRawPtr<Widget> widget = m_persistedPluginWidget; | 
| 487 if (!widget) { | 502 if (!widget) { | 
| 488 bool loadManually = document().isPluginDocument() && !document().contain sPlugins(); | 503 bool loadManually = document().isPluginDocument() && !document().contain sPlugins(); | 
| 489 FrameLoaderClient::DetachedPluginPolicy policy = requireRenderer ? Frame LoaderClient::FailOnDetachedPlugin : FrameLoaderClient::AllowDetachedPlugin; | 504 FrameLoaderClient::DetachedPluginPolicy policy = requireRenderer ? Frame LoaderClient::FailOnDetachedPlugin : FrameLoaderClient::AllowDetachedPlugin; | 
| 490 widget = frame->loader().client()->createPlugin(this, url, paramNames, p aramValues, mimeType, loadManually, policy); | 505 widget = frame->loader().client()->createPlugin(this, url, paramNames, p aramValues, mimeType, loadManually, policy); | 
| 491 } | 506 } | 
| 492 | 507 | 
| 493 if (!widget) { | 508 if (!widget) { | 
| 494 if (renderer && !renderer->showsUnavailablePluginIndicator()) | 509 if (renderer && !renderer->showsUnavailablePluginIndicator()) | 
| 495 renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::Plugin Missing); | 510 renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::Plugin Missing); | 
| 496 return false; | 511 return false; | 
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 592 | 607 | 
| 593 void HTMLPlugInElement::setUsePlaceholderContent(bool use) | 608 void HTMLPlugInElement::setUsePlaceholderContent(bool use) | 
| 594 { | 609 { | 
| 595 if (use != m_usePlaceholderContent) { | 610 if (use != m_usePlaceholderContent) { | 
| 596 m_usePlaceholderContent = use; | 611 m_usePlaceholderContent = use; | 
| 597 lazyReattachIfAttached(); | 612 lazyReattachIfAttached(); | 
| 598 } | 613 } | 
| 599 } | 614 } | 
| 600 | 615 | 
| 601 } | 616 } | 
| OLD | NEW |