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

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

Issue 2626403002: Move Frame pointer to be held by DOMWindow base class. (Closed)
Patch Set: . Created 3 years, 11 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/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index 483b20d5ed6f419fa04435a6d3172adf5f0bac61..ca0c5bb02e96392783b839587223e3963fce6041 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -272,7 +272,7 @@ bool LocalDOMWindow::allowPopUp() {
}
LocalDOMWindow::LocalDOMWindow(LocalFrame& frame)
- : m_frame(&frame),
+ : DOMWindow(frame),
m_visualViewport(DOMVisualViewport::create(this)),
m_unusedPreloadsTimer(
TaskRunnerHelper::get(TaskType::UnspecedTimer, &frame),
@@ -484,7 +484,7 @@ void LocalDOMWindow::frameDestroyed() {
resetLocation();
m_properties.clear();
removeAllEventListeners();
- m_frame = nullptr;
+ disconnectFromFrame();
}
void LocalDOMWindow::registerProperty(DOMWindowProperty* property) {
@@ -1607,7 +1607,6 @@ DOMWindow* LocalDOMWindow::open(const String& urlString,
}
DEFINE_TRACE(LocalDOMWindow) {
- visitor->trace(m_frame);
visitor->trace(m_document);
visitor->trace(m_properties);
visitor->trace(m_screen);
@@ -1635,12 +1634,4 @@ DEFINE_TRACE_WRAPPERS(LocalDOMWindow) {
DOMWindow::traceWrappers(visitor);
}
-LocalFrame* LocalDOMWindow::frame() const {
- // If the LocalDOMWindow still has a frame reference, that frame must point
- // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
- // where script execution leaks between different LocalDOMWindows.
- SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this);
- return m_frame;
-}
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698