Commit cd39529a authored by andersca@apple.com's avatar andersca@apple.com

History::StateObjectType should be a strong enum

https://bugs.webkit.org/show_bug.cgi?id=126725

Reviewed by Beth Dakin.

* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
* loader/HistoryController.cpp:
(WebCore::HistoryController::pushState):
* page/History.cpp:
(WebCore::History::stateObjectAdded):
* page/History.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2ef48cc2
2014-01-09 Anders Carlsson <andersca@apple.com>
History::StateObjectType should be a strong enum
https://bugs.webkit.org/show_bug.cgi?id=126725
Reviewed by Beth Dakin.
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
* loader/HistoryController.cpp:
(WebCore::HistoryController::pushState):
* page/History.cpp:
(WebCore::History::stateObjectAdded):
* page/History.h:
2014-01-09 Daniel Bates <dabates@apple.com>
Attempt to fix the Mountain Lion Release (32-bit) build following <http://trac.webkit.org/changeset/161589>
......@@ -161,7 +161,7 @@ JSValue JSHistory::pushState(ExecState* exec)
}
ExceptionCode ec = 0;
impl().stateObjectAdded(historyState.release(), title, url, History::StateObjectPush, ec);
impl().stateObjectAdded(historyState.release(), title, url, History::StateObjectType::Push, ec);
setDOMException(exec, ec);
m_state.clear();
......@@ -187,7 +187,7 @@ JSValue JSHistory::replaceState(ExecState* exec)
}
ExceptionCode ec = 0;
impl().stateObjectAdded(historyState.release(), title, url, History::StateObjectReplace, ec);
impl().stateObjectAdded(historyState.release(), title, url, History::StateObjectType::Replace, ec);
setDOMException(exec, ec);
m_state.clear();
......
......@@ -855,7 +855,6 @@ void HistoryController::pushState(PassRefPtr<SerializedScriptValue> stateObject,
addVisitedLink(page, URL(ParsedURLString, urlString));
m_frame.loader().client().updateGlobalHistory();
}
void HistoryController::replaceState(PassRefPtr<SerializedScriptValue> stateObject, const String& title, const String& urlString)
......
......@@ -147,17 +147,17 @@ void History::stateObjectAdded(PassRefPtr<SerializedScriptValue> data, const Str
return;
}
if (stateObjectType == StateObjectPush)
if (stateObjectType == StateObjectType::Push)
m_frame->loader().history().pushState(data, title, fullURL.string());
else if (stateObjectType == StateObjectReplace)
else if (stateObjectType == StateObjectType::Replace)
m_frame->loader().history().replaceState(data, title, fullURL.string());
if (!urlString.isEmpty())
m_frame->document()->updateURLForPushOrReplaceState(fullURL);
if (stateObjectType == StateObjectPush)
if (stateObjectType == StateObjectType::Push)
m_frame->loader().client().dispatchDidPushStateWithinPage();
else if (stateObjectType == StateObjectReplace)
else if (stateObjectType == StateObjectType::Replace)
m_frame->loader().client().dispatchDidReplaceStateWithinPage();
}
......
......@@ -57,9 +57,9 @@ public:
bool stateChanged() const;
bool isSameAsCurrentState(SerializedScriptValue*) const;
enum StateObjectType {
StateObjectPush,
StateObjectReplace
enum class StateObjectType {
Push,
Replace
};
void stateObjectAdded(PassRefPtr<SerializedScriptValue>, const String& title, const String& url, StateObjectType, ExceptionCode&);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment