Index: Source/core/frame/DOMWindow.cpp |
diff --git a/Source/core/frame/DOMWindow.cpp b/Source/core/frame/DOMWindow.cpp |
index 10606a074f8f36bb6f5dd7b735ef1a6dfd0ad80a..b2d4f7d7dec26d7179bb6d00329c119b12bc01f7 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,11 @@ bool DOMWindow::isInsecureScriptAccess(DOMWindow& callingWindow, const String& u |
return true; |
} |
+void DOMWindow::reset() |
+{ |
+ // Location needs to be reset manually because it doesn't inherit from DOMWindowProperty. |
haraken
2015/02/03 00:56:09
I'm just curious, but why can't Location inherit f
dcheng
2015/02/03 08:22:54
Location was the only DOMWindowProperty that neede
haraken
2015/02/03 08:24:09
Thanks, sounds reasonable to me.
|
+ m_location->reset(); |
+ m_location = nullptr; |
+} |
+ |
} // namespace blink |