| Index: third_party/WebKit/WebCore/loader/FrameLoader.cpp
|
| ===================================================================
|
| --- third_party/WebKit/WebCore/loader/FrameLoader.cpp (revision 11154)
|
| +++ third_party/WebKit/WebCore/loader/FrameLoader.cpp (working copy)
|
| @@ -144,16 +144,17 @@
|
|
|
| struct ScheduledRedirection {
|
| enum Type { redirection, locationChange, historyNavigation, locationChangeDuringLoad };
|
| - Type type;
|
| - double delay;
|
| - String url;
|
| - String referrer;
|
| - int historySteps;
|
| - bool lockHistory;
|
| - bool lockBackForwardList;
|
| - bool wasUserGesture;
|
| - bool wasRefresh;
|
|
|
| + const Type type;
|
| + const double delay;
|
| + const String url;
|
| + const String referrer;
|
| + const int historySteps;
|
| + const bool lockHistory;
|
| + const bool lockBackForwardList;
|
| + const bool wasUserGesture;
|
| + const bool wasRefresh;
|
| +
|
| ScheduledRedirection(double delay, const String& url, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool refresh)
|
| : type(redirection)
|
| , delay(delay)
|
| @@ -164,6 +165,7 @@
|
| , wasUserGesture(wasUserGesture)
|
| , wasRefresh(refresh)
|
| {
|
| + ASSERT(!url.isEmpty());
|
| }
|
|
|
| ScheduledRedirection(Type locationChangeType, const String& url, const String& referrer, bool lockHistory, bool lockBackForwardList, bool wasUserGesture, bool refresh)
|
| @@ -177,6 +179,8 @@
|
| , wasUserGesture(wasUserGesture)
|
| , wasRefresh(refresh)
|
| {
|
| + ASSERT(locationChangeType == locationChange || locationChangeType == locationChangeDuringLoad);
|
| + ASSERT(!url.isEmpty());
|
| }
|
|
|
| explicit ScheduledRedirection(int historyNavigationSteps)
|
| @@ -184,6 +188,7 @@
|
| , delay(0)
|
| , historySteps(historyNavigationSteps)
|
| , lockHistory(false)
|
| + , lockBackForwardList(false)
|
| , wasUserGesture(false)
|
| , wasRefresh(false)
|
| {
|
| @@ -1323,6 +1328,9 @@
|
| if (!m_frame->page())
|
| return;
|
|
|
| + if (url.isEmpty())
|
| + return;
|
| +
|
| // We want a new history item if the refresh timeout is > 1 second.
|
| if (!m_scheduledRedirection || delay <= m_scheduledRedirection->delay)
|
| scheduleRedirection(new ScheduledRedirection(delay, url, true, delay <= 1, false, false));
|
| @@ -1333,6 +1341,9 @@
|
| if (!m_frame->page())
|
| return;
|
|
|
| + if (url.isEmpty())
|
| + return;
|
| +
|
| // If the URL we're going to navigate to is the same as the current one, except for the
|
| // fragment part, we don't need to schedule the location change.
|
| KURL parsedURL(url);
|
| @@ -1364,6 +1375,9 @@
|
| if (!m_frame->page())
|
| return;
|
|
|
| + if (m_URL.isEmpty())
|
| + return;
|
| +
|
| ScheduledRedirection::Type type = ScheduledRedirection::locationChange;
|
| scheduleRedirection(new ScheduledRedirection(type, m_URL.string(), m_outgoingReferrer, true, true, wasUserGesture, true));
|
| }
|
| @@ -1475,13 +1489,14 @@
|
| void FrameLoader::loadURLIntoChildFrame(const KURL& url, const String& referer, Frame* childFrame)
|
| {
|
| ASSERT(childFrame);
|
| +
|
| HistoryItem* parentItem = currentHistoryItem();
|
| FrameLoadType loadType = this->loadType();
|
| FrameLoadType childLoadType = FrameLoadTypeRedirectWithLockedBackForwardList;
|
|
|
| KURL workingURL = url;
|
|
|
| - // If we're moving in the backforward list, we might want to replace the content
|
| + // If we're moving in the back/forward list, we might want to replace the content
|
| // of this child frame with whatever was there at that point.
|
| if (parentItem && parentItem->children().size() && isBackForwardLoadType(loadType)) {
|
| HistoryItem* childItem = parentItem->childItemWithName(childFrame->tree()->name());
|
|
|