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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2764313002: Move plugins to be stored in HTMLPlugInElement. (Closed)
Patch Set: Use plugin and frame in updateGeometries Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 91c82bdcf3276ac701da5bd92e86ee05da3e6acf..1d54b094cb8ce9b1f4021ca48779ad96c1e38dab 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -100,7 +100,6 @@
#include "core/paint/PaintLayer.h"
#include "core/paint/PaintTiming.h"
#include "core/paint/PrePaintTreeWalk.h"
-#include "core/plugins/PluginView.h"
#include "core/style/ComputedStyle.h"
#include "core/svg/SVGDocumentExtensions.h"
#include "core/svg/SVGSVGElement.h"
@@ -237,6 +236,7 @@ DEFINE_TRACE(FrameView) {
visitor->trace(m_animatingScrollableAreas);
visitor->trace(m_autoSizeInfo);
visitor->trace(m_children);
+ visitor->trace(m_plugins);
visitor->trace(m_viewportScrollableArea);
visitor->trace(m_visibilityObserver);
visitor->trace(m_scrollAnchor);
@@ -1484,7 +1484,7 @@ void FrameView::updateGeometries() {
if (layoutViewItem().isNull())
break;
- if (FrameViewBase* frameViewBase = part->frameViewBase()) {
+ if (FrameViewBase* frameViewBase = part->pluginOrFrame()) {
if (frameViewBase->isFrameView()) {
FrameView* frameView = toFrameView(frameViewBase);
bool didNeedLayout = frameView->needsLayout();
@@ -3321,10 +3321,8 @@ void FrameView::updateStyleAndLayoutIfNeededRecursiveInternal() {
// TODO(leviw): This currently runs the entire lifecycle on plugin WebViews.
// We should have a way to only run these other Documents to the same
// lifecycle stage as this frame.
- const ChildrenSet* viewChildren = children();
- for (const Member<FrameViewBase>& child : *viewChildren) {
- if ((*child).isPluginContainer())
- toPluginView(child.get())->updateAllLifecyclePhases();
+ for (const Member<PluginView>& plugin : *plugins()) {
+ plugin->updateAllLifecyclePhases();
}
checkDoesNotNeedLayout();
@@ -3785,6 +3783,16 @@ void FrameView::removeChild(FrameViewBase* child) {
m_children.erase(child);
}
+void FrameView::removePlugin(PluginView* plugin) {
+ DCHECK(m_plugins.contains(plugin));
+ m_plugins.erase(plugin);
+}
+
+void FrameView::addPlugin(PluginView* plugin) {
+ DCHECK(!m_plugins.contains(plugin));
+ m_plugins.insert(plugin);
+}
+
bool FrameView::visualViewportSuppliesScrollbars() {
// On desktop, we always use the layout viewport's scrollbars.
if (!m_frame->settings() || !m_frame->settings()->getViewportEnabled() ||
@@ -3871,7 +3879,8 @@ IntSize FrameView::maximumScrollOffsetInt() const {
}
void FrameView::addChild(FrameViewBase* child) {
- ASSERT(child != this && !child->parent());
+ DCHECK(child != this && !child->parent());
+ DCHECK(!child->isPluginView());
child->setParent(this);
m_children.insert(child);
}

Powered by Google App Engine
This is Rietveld 408576698