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

Unified Diff: Source/core/loader/NavigationScheduler.cpp

Issue 414223004: Implement NavigationScheduler::schedulePageBlock() as a redirect to empty substitute data. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
« no previous file with comments | « LayoutTests/http/tests/security/xssAuditor/xss-protection-parsing-04-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/NavigationScheduler.cpp
diff --git a/Source/core/loader/NavigationScheduler.cpp b/Source/core/loader/NavigationScheduler.cpp
index 25db42fcde25b56361cd136c79ccc91839eace80..f0babd3db32e55035d6f3d210ccf95891d982fd4 100644
--- a/Source/core/loader/NavigationScheduler.cpp
+++ b/Source/core/loader/NavigationScheduler.cpp
@@ -48,6 +48,7 @@
#include "core/loader/FrameLoaderStateMachine.h"
#include "core/page/BackForwardClient.h"
#include "core/page/Page.h"
+#include "platform/SharedBuffer.h"
#include "platform/UserGestureIndicator.h"
#include "wtf/CurrentTime.h"
@@ -174,6 +175,24 @@ public:
}
};
+class ScheduledPageBlock FINAL : public ScheduledURLNavigation {
+public:
+ ScheduledPageBlock(Document* originDocument, const String& url, const Referrer& referrer)
+ : ScheduledURLNavigation(0.0, originDocument, url, referrer, true, true)
+ {
+ }
+
+ virtual void fire(LocalFrame* frame) OVERRIDE
+ {
+ OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicator();
Mike West 2014/07/30 16:57:39 Nit: Do we need a user gesture here?
+ SubstituteData substituteData(SharedBuffer::create(), "text/plain", "UTF-8", KURL(), ForceSynchronousLoad);
+ FrameLoadRequest request(originDocument(), ResourceRequest(KURL(ParsedURLString, url()), referrer(), ReloadIgnoringCacheData), substituteData);
+ request.setLockBackForwardList(true);
+ request.setClientRedirect(ClientRedirect);
+ frame->loader().load(request);
+ }
+};
+
class ScheduledHistoryNavigation FINAL : public ScheduledNavigation {
public:
explicit ScheduledHistoryNavigation(int historySteps)
@@ -330,7 +349,8 @@ void NavigationScheduler::scheduleLocationChange(Document* originDocument, const
void NavigationScheduler::schedulePageBlock(Document* originDocument, const Referrer& referrer)
{
ASSERT(m_frame->page());
- schedule(adoptPtr(new ScheduledLocationChange(originDocument, SecurityOrigin::urlWithUniqueSecurityOrigin(), referrer, false)));
+ const KURL& url = m_frame->document()->url();
Nate Chapin 2014/07/25 20:33:38 Inline this?
+ schedule(adoptPtr(new ScheduledPageBlock(originDocument, url, referrer)));
}
void NavigationScheduler::scheduleFormSubmission(PassRefPtrWillBeRawPtr<FormSubmission> submission)
« no previous file with comments | « LayoutTests/http/tests/security/xssAuditor/xss-protection-parsing-04-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698