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

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

Issue 879423003: Move Location to DOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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
Index: Source/core/frame/History.cpp
diff --git a/Source/core/frame/History.cpp b/Source/core/frame/History.cpp
index b1cb482d5fb78fff2e9f4b6d8003fc5cf21200a8..cf215836038d8d6be67246fb5396e2ceb0ad87ec 100644
--- a/Source/core/frame/History.cpp
+++ b/Source/core/frame/History.cpp
@@ -54,9 +54,9 @@ void History::trace(Visitor* visitor)
unsigned History::length() const
{
- if (!m_frame || !m_frame->loader().client())
+ if (!localFrame() || !localFrame()->loader().client())
return 0;
- return m_frame->loader().client()->backForwardLength();
+ return localFrame()->loader().client()->backForwardLength();
}
SerializedScriptValue* History::state()
@@ -67,10 +67,10 @@ SerializedScriptValue* History::state()
SerializedScriptValue* History::stateInternal() const
{
- if (!m_frame)
+ if (!localFrame())
return 0;
- if (HistoryItem* historyItem = m_frame->loader().currentItem())
+ if (HistoryItem* historyItem = localFrame()->loader().currentItem())
return historyItem->stateObject();
return 0;
@@ -98,7 +98,7 @@ void History::forward(ExecutionContext* context)
void History::go(ExecutionContext* context, int distance)
{
- if (!m_frame || !m_frame->loader().client())
+ if (!localFrame() || !localFrame()->loader().client())
return;
ASSERT(isMainThread());
@@ -110,14 +110,14 @@ void History::go(ExecutionContext* context, int distance)
return;
if (distance)
- m_frame->loader().client()->navigateBackForward(distance);
+ localFrame()->loader().client()->navigateBackForward(distance);
else
m_frame->reload(NormalReload, ClientRedirect);
}
KURL History::urlForState(const String& urlString)
{
- Document* document = m_frame->document();
+ Document* document = localFrame()->document();
if (urlString.isNull())
return document->url();
@@ -129,16 +129,16 @@ KURL History::urlForState(const String& urlString)
void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const String& /* title */, const String& urlString, FrameLoadType type, ExceptionState& exceptionState)
{
- if (!m_frame || !m_frame->page() || !m_frame->loader().documentLoader())
+ if (!localFrame() || !localFrame()->page() || !localFrame()->loader().documentLoader())
return;
KURL fullURL = urlForState(urlString);
- if (!fullURL.isValid() || !m_frame->document()->securityOrigin()->canRequest(fullURL)) {
+ if (!fullURL.isValid() || !m_frame->securityContext()->securityOrigin()->canRequest(fullURL)) {
// We can safely expose the URL to JavaScript, as a) no redirection takes place: JavaScript already had this URL, b) JavaScript can only access a same-origin History object.
- exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_frame->document()->securityOrigin()->toString() + "'.");
+ exceptionState.throwSecurityError("A history state object with URL '" + fullURL.elidedString() + "' cannot be created in a document with origin '" + m_frame->securityContext()->securityOrigin()->toString() + "'.");
return;
}
- m_frame->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavigationHistoryApi, data, type);
+ localFrame()->loader().updateForSameDocumentNavigation(fullURL, SameDocumentNavigationHistoryApi, data, type);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698