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

Unified Diff: third_party/WebKit/WebCore/loader/FrameLoader.cpp

Issue 39293: WebKit merge 41447:41498 [third_party/WebKit] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove CRLF Created 11 years, 10 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: 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());
« no previous file with comments | « third_party/WebKit/WebCore/loader/EmptyClients.h ('k') | third_party/WebKit/WebCore/loader/TextResourceDecoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698