| Index: Source/core/frame/Location.cpp
|
| diff --git a/Source/core/frame/Location.cpp b/Source/core/frame/Location.cpp
|
| index 45b0ea5cdeecaa4238c66d32d6aa8a789c0cae5b..87a03f048ee782fadede7721bb79d111729b2b9f 100644
|
| --- a/Source/core/frame/Location.cpp
|
| +++ b/Source/core/frame/Location.cpp
|
| @@ -42,7 +42,7 @@
|
|
|
| namespace blink {
|
|
|
| -Location::Location(LocalFrame* frame)
|
| +Location::Location(Frame* frame)
|
| : DOMWindowProperty(frame)
|
| {
|
| }
|
| @@ -54,9 +54,9 @@ void Location::trace(Visitor* visitor)
|
|
|
| inline const KURL& Location::url() const
|
| {
|
| - ASSERT(m_frame);
|
| + ASSERT(m_frame && m_frame->isLocalFrame());
|
|
|
| - const KURL& url = m_frame->document()->url();
|
| + const KURL& url = localFrame()->document()->url();
|
| if (!url.isValid())
|
| return blankURL(); // Use "about:blank" while the page is still loading (before we have a frame).
|
|
|
| @@ -149,7 +149,8 @@ void Location::setProtocol(LocalDOMWindow* callingWindow, LocalDOMWindow* entere
|
| {
|
| if (!m_frame)
|
| return;
|
| - KURL url = m_frame->document()->url();
|
| + ASSERT(m_frame->isLocalFrame());
|
| + KURL url = localFrame()->document()->url();
|
| if (!url.setProtocol(protocol)) {
|
| exceptionState.throwDOMException(SyntaxError, "'" + protocol + "' is an invalid protocol.");
|
| return;
|
| @@ -161,7 +162,8 @@ void Location::setHost(LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWin
|
| {
|
| if (!m_frame)
|
| return;
|
| - KURL url = m_frame->document()->url();
|
| + ASSERT(m_frame->isLocalFrame());
|
| + KURL url = localFrame()->document()->url();
|
| url.setHostAndPort(host);
|
| setLocation(url.string(), callingWindow, enteredWindow);
|
| }
|
| @@ -170,7 +172,8 @@ void Location::setHostname(LocalDOMWindow* callingWindow, LocalDOMWindow* entere
|
| {
|
| if (!m_frame)
|
| return;
|
| - KURL url = m_frame->document()->url();
|
| + ASSERT(m_frame->isLocalFrame());
|
| + KURL url = localFrame()->document()->url();
|
| url.setHost(hostname);
|
| setLocation(url.string(), callingWindow, enteredWindow);
|
| }
|
| @@ -179,7 +182,8 @@ void Location::setPort(LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWin
|
| {
|
| if (!m_frame)
|
| return;
|
| - KURL url = m_frame->document()->url();
|
| + ASSERT(m_frame->isLocalFrame());
|
| + KURL url = localFrame()->document()->url();
|
| url.setPort(portString);
|
| setLocation(url.string(), callingWindow, enteredWindow);
|
| }
|
| @@ -188,7 +192,8 @@ void Location::setPathname(LocalDOMWindow* callingWindow, LocalDOMWindow* entere
|
| {
|
| if (!m_frame)
|
| return;
|
| - KURL url = m_frame->document()->url();
|
| + ASSERT(m_frame->isLocalFrame());
|
| + KURL url = localFrame()->document()->url();
|
| url.setPath(pathname);
|
| setLocation(url.string(), callingWindow, enteredWindow);
|
| }
|
| @@ -197,7 +202,8 @@ void Location::setSearch(LocalDOMWindow* callingWindow, LocalDOMWindow* enteredW
|
| {
|
| if (!m_frame)
|
| return;
|
| - KURL url = m_frame->document()->url();
|
| + ASSERT(m_frame->isLocalFrame());
|
| + KURL url = localFrame()->document()->url();
|
| url.setQuery(search);
|
| setLocation(url.string(), callingWindow, enteredWindow);
|
| }
|
| @@ -206,7 +212,8 @@ void Location::setHash(LocalDOMWindow* callingWindow, LocalDOMWindow* enteredWin
|
| {
|
| if (!m_frame)
|
| return;
|
| - KURL url = m_frame->document()->url();
|
| + ASSERT(m_frame->isLocalFrame());
|
| + KURL url = localFrame()->document()->url();
|
| String oldFragmentIdentifier = url.fragmentIdentifier();
|
| String newFragmentIdentifier = hash;
|
| if (hash[0] == '#')
|
| @@ -238,7 +245,8 @@ void Location::reload(LocalDOMWindow* callingWindow)
|
| {
|
| if (!m_frame)
|
| return;
|
| - if (protocolIsJavaScript(m_frame->document()->url()))
|
| + ASSERT(m_frame->isLocalFrame());
|
| + if (protocolIsJavaScript(localFrame()->document()->url()))
|
| return;
|
| m_frame->reload(NormalReload, ClientRedirect);
|
| }
|
|
|