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

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

Issue 879423003: Move Location to DOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase, #include cleanup Created 5 years, 10 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
« no previous file with comments | « Source/core/frame/DOMWindow.h ('k') | Source/core/frame/Frame.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/DOMWindow.cpp
diff --git a/Source/core/frame/DOMWindow.cpp b/Source/core/frame/DOMWindow.cpp
index 10606a074f8f36bb6f5dd7b735ef1a6dfd0ad80a..f3e31d86f9d3f1287acf41a3ac2d7d922bc955d9 100644
--- a/Source/core/frame/DOMWindow.cpp
+++ b/Source/core/frame/DOMWindow.cpp
@@ -8,11 +8,23 @@
#include "core/dom/SecurityContext.h"
#include "core/frame/Frame.h"
#include "core/frame/FrameClient.h"
+#include "core/frame/Location.h"
#include "platform/weborigin/KURL.h"
#include "platform/weborigin/SecurityOrigin.h"
namespace blink {
+DOMWindow::~DOMWindow()
+{
+}
+
+Location* DOMWindow::location() const
+{
+ if (!m_location)
+ m_location = Location::create(frame());
+ return m_location.get();
+}
+
bool DOMWindow::closed() const
{
return !frame() || !frame()->host();
@@ -92,4 +104,20 @@ bool DOMWindow::isInsecureScriptAccess(DOMWindow& callingWindow, const String& u
return true;
}
+void DOMWindow::resetLocation()
+{
+ // Location needs to be reset manually because it doesn't inherit from DOMWindowProperty.
+ // DOMWindowProperty is local-only, and Location needs to support remote windows, too.
+ if (m_location) {
+ m_location->reset();
+ m_location = nullptr;
+ }
+}
+
+void DOMWindow::trace(Visitor* visitor)
+{
+ visitor->trace(m_location);
+ EventTargetWithInlineData::trace(visitor);
+}
+
} // namespace blink
« no previous file with comments | « Source/core/frame/DOMWindow.h ('k') | Source/core/frame/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698