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

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

Issue 2562323002: Devirtualize Frame::domWindow(). (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index eff2a0ca095333329cdc9880221ce0fc37ee5136..c5b2158145c0e2df2d15d8fad69158b28491d77d 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -349,10 +349,6 @@ DEFINE_TRACE(LocalFrame) {
Supplementable<LocalFrame>::trace(visitor);
}
-DOMWindow* LocalFrame::domWindow() const {
- return m_domWindow.get();
-}
-
WindowProxy* LocalFrame::windowProxy(DOMWrapperWorld& world) {
return m_script->windowProxy(world);
}
@@ -429,9 +425,9 @@ void LocalFrame::detach(FrameDetachType type) {
script().clearForClose();
setView(nullptr);
- m_host->eventHandlerRegistry().didRemoveAllEventHandlers(*localDOMWindow());
+ m_host->eventHandlerRegistry().didRemoveAllEventHandlers(*domWindow());
- localDOMWindow()->frameDestroyed();
+ domWindow()->frameDestroyed();
// TODO: Page should take care of updating focus/scrolling instead of Frame.
// TODO: It's unclear as to why this is called more than once, but it is,
@@ -474,7 +470,7 @@ void LocalFrame::printNavigationErrorMessage(const Frame& targetFrame,
targetFrameDescription + " from frame with URL '" +
document()->url().getString() + "'. " + reason + "\n";
- localDOMWindow()->printErrorMessage(message);
+ domWindow()->printErrorMessage(message);
}
WindowProxyManager* LocalFrame::getWindowProxyManager() const {
@@ -500,6 +496,10 @@ void LocalFrame::documentAttached() {
inputMethodController().documentAttached(document());
}
+LocalDOMWindow* LocalFrame::domWindow() const {
+ return toLocalDOMWindow(m_domWindow);
+}
+
void LocalFrame::setDOMWindow(LocalDOMWindow* domWindow) {
// TODO(haraken): Update this comment.
// Oilpan: setDOMWindow() cannot be used when finalizing. Which
@@ -519,8 +519,8 @@ void LocalFrame::setDOMWindow(LocalDOMWindow* domWindow) {
if (domWindow)
script().clearWindowProxy();
- if (m_domWindow)
- m_domWindow->reset();
+ if (this->domWindow())
+ this->domWindow()->reset();
m_domWindow = domWindow;
haraken 2016/12/12 09:54:59 LocalFrame::m_domWindow is reset here. Where is Re
dcheng 2016/12/12 10:21:39 LocalDOMWindow is swapped on navigation, but Remot
}

Powered by Google App Engine
This is Rietveld 408576698