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

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

Issue 1514073002: Oilpan: always limit persisted plugin disposal to PluginViews instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 { 87 {
88 visitor->trace(m_imageLoader); 88 visitor->trace(m_imageLoader);
89 visitor->trace(m_persistedPluginWidget); 89 visitor->trace(m_persistedPluginWidget);
90 HTMLFrameOwnerElement::trace(visitor); 90 HTMLFrameOwnerElement::trace(visitor);
91 } 91 }
92 92
93 #if ENABLE(OILPAN) 93 #if ENABLE(OILPAN)
94 void HTMLPlugInElement::disconnectContentFrame() 94 void HTMLPlugInElement::disconnectContentFrame()
95 { 95 {
96 if (m_persistedPluginWidget) { 96 if (m_persistedPluginWidget) {
97 m_persistedPluginWidget->dispose(); 97 if (m_persistedPluginWidget->isPluginView())
98 m_persistedPluginWidget->dispose();
dcheng 2015/12/11 07:47:09 Is the only other possible case here that m_persis
sof 2015/12/11 08:01:18 Yes, I think it is safe to do the disposal uncondi
dcheng 2015/12/11 08:11:22 Let's add an else { ASSERT(m_persistedPluginWidget
98 m_persistedPluginWidget = nullptr; 99 m_persistedPluginWidget = nullptr;
99 } 100 }
100 HTMLFrameOwnerElement::disconnectContentFrame(); 101 HTMLFrameOwnerElement::disconnectContentFrame();
101 } 102 }
102 103
103 void HTMLPlugInElement::shouldDisposePlugin() 104 void HTMLPlugInElement::shouldDisposePlugin()
104 { 105 {
105 if (m_persistedPluginWidget && m_persistedPluginWidget->isPluginView()) 106 if (m_persistedPluginWidget && m_persistedPluginWidget->isPluginView())
106 toPluginView(m_persistedPluginWidget.get())->shouldDisposePlugin(); 107 toPluginView(m_persistedPluginWidget.get())->shouldDisposePlugin();
107 } 108 }
108 #endif 109 #endif
109 110
110 void HTMLPlugInElement::setPersistedPluginWidget(Widget* widget) 111 void HTMLPlugInElement::setPersistedPluginWidget(Widget* widget)
111 { 112 {
112 if (m_persistedPluginWidget == widget) 113 if (m_persistedPluginWidget == widget)
113 return; 114 return;
114 #if ENABLE(OILPAN) 115 #if ENABLE(OILPAN)
115 unregisterAsRenderlessIfNeeded(); 116 unregisterAsRenderlessIfNeeded();
116 registerAsRenderless(widget); 117 registerAsRenderless(widget);
117 if (m_persistedPluginWidget) { 118 if (m_persistedPluginWidget && m_persistedPluginWidget->isPluginView()) {
dcheng 2015/12/11 08:11:22 Ditto, let's split this so we can have an explicit
118 m_persistedPluginWidget->hide(); 119 m_persistedPluginWidget->hide();
119 m_persistedPluginWidget->dispose(); 120 m_persistedPluginWidget->dispose();
120 } 121 }
121 #endif 122 #endif
122 m_persistedPluginWidget = widget; 123 m_persistedPluginWidget = widget;
123 } 124 }
124 125
125 #if ENABLE(OILPAN) 126 #if ENABLE(OILPAN)
126 bool HTMLPlugInElement::unregisterAsRenderlessIfNeeded() 127 bool HTMLPlugInElement::unregisterAsRenderlessIfNeeded()
127 { 128 {
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 return openShadowRoot(); 664 return openShadowRoot();
664 } 665 }
665 666
666 void HTMLPlugInElement::lazyReattachIfNeeded() 667 void HTMLPlugInElement::lazyReattachIfNeeded()
667 { 668 {
668 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma geType()) 669 if (!useFallbackContent() && needsWidgetUpdate() && layoutObject() && !isIma geType())
669 lazyReattachIfAttached(); 670 lazyReattachIfAttached();
670 } 671 }
671 672
672 } 673 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698