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

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

Issue 683013002: Extract a DOMWindow interface from LocalDOMWindow and use it in the idl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix incorrect assumption Created 6 years, 1 month 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: Source/core/frame/LocalDOMWindow.cpp
diff --git a/Source/core/frame/LocalDOMWindow.cpp b/Source/core/frame/LocalDOMWindow.cpp
index 49b4499e49c13c678d9234990b740ba32c13130e..13eda6968a6bdd0afa7ac6d7f2ac641969e0c142 100644
--- a/Source/core/frame/LocalDOMWindow.cpp
+++ b/Source/core/frame/LocalDOMWindow.cpp
@@ -645,8 +645,9 @@ void LocalDOMWindow::sendOrientationChangeEvent()
dispatchEvent(Event::create(EventTypeNames::orientationchange));
for (size_t i = 0; i < childFrames.size(); ++i) {
- if (childFrames[i]->domWindow())
- childFrames[i]->domWindow()->sendOrientationChangeEvent();
+ if (!childFrames[i]->isLocalFrame())
+ continue;
+ toLocalFrame(childFrames[i].get())->localDOMWindow()->sendOrientationChangeEvent();
}
}
@@ -1855,24 +1856,25 @@ PassRefPtrWillBeRawPtr<LocalDOMWindow> LocalDOMWindow::open(const String& urlStr
}
// FIXME: Navigating RemoteFrames is not yet supported.
if (targetFrame && targetFrame->isLocalFrame()) {
- if (!activeDocument->canNavigate(*targetFrame))
+ LocalFrame* localTargetFrame = toLocalFrame(targetFrame);
+ if (!activeDocument->canNavigate(*localTargetFrame))
return nullptr;
KURL completedURL = firstFrame->document()->completeURL(urlString);
- if (targetFrame->domWindow()->isInsecureScriptAccess(*callingWindow, completedURL))
- return targetFrame->domWindow();
+ if (localTargetFrame->localDOMWindow()->isInsecureScriptAccess(*callingWindow, completedURL))
+ return localTargetFrame->localDOMWindow();
if (urlString.isEmpty())
- return targetFrame->domWindow();
+ return localTargetFrame->localDOMWindow();
- toLocalFrame(targetFrame)->navigationScheduler().scheduleLocationChange(activeDocument, completedURL, false);
- return targetFrame->domWindow();
+ localTargetFrame->navigationScheduler().scheduleLocationChange(activeDocument, completedURL, false);
+ return localTargetFrame->localDOMWindow();
}
WindowFeatures windowFeatures(windowFeaturesString);
LocalFrame* result = createWindow(urlString, frameName, windowFeatures, *callingWindow, *firstFrame, *frame());
- return result ? result->domWindow() : 0;
+ return result ? result->localDOMWindow() : 0;
}
void LocalDOMWindow::showModalDialog(const String& urlString, const String& dialogFeaturesString,
@@ -1907,8 +1909,9 @@ LocalDOMWindow* LocalDOMWindow::anonymousIndexedGetter(uint32_t index)
return 0;
Frame* child = frame()->tree().scopedChild(index);
+ // FIXME: Temporary hack to stage the conversions.
if (child)
- return child->domWindow();
+ return static_cast<LocalDOMWindow*>(child->domWindow());
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698