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

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

Issue 2555963003: FasterLocationReload: use ReloadMainResource for JS exposed reloads (Closed)
Patch Set: more comments Created 4 years 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/Source/core/loader/NavigationScheduler.cpp
diff --git a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
index 0abc6a5e2d23273348c0a6b4f4e83a4d5b6ec8ad..ba5a381600a179b871c3fe0c05d364cb40f3b787 100644
--- a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
+++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
@@ -258,7 +258,10 @@ class ScheduledLocationChange final : public ScheduledURLNavigation {
class ScheduledReload final : public ScheduledNavigation {
public:
- static ScheduledReload* create() { return new ScheduledReload; }
+ static ScheduledReload* create(FrameLoadType type) {
+ DCHECK(isReloadLoadType(type));
+ return new ScheduledReload(type);
+ }
void fire(LocalFrame* frame) override {
std::unique_ptr<UserGestureIndicator> gestureIndicator =
@@ -271,11 +274,14 @@ class ScheduledReload final : public ScheduledNavigation {
request.setClientRedirect(ClientRedirectPolicy::ClientRedirect);
maybeLogScheduledNavigationClobber(ScheduledNavigationType::ScheduledReload,
frame);
- frame->loader().load(request, FrameLoadTypeReload);
+ frame->loader().load(request, m_type);
kouhei (in TOK) 2016/12/14 10:57:41 Instead of referring to m_type here, can this also
Takashi Toyoshima 2016/12/14 12:31:10 Done.
}
private:
- ScheduledReload() : ScheduledNavigation(0.0, nullptr, true, true) {}
+ ScheduledReload(FrameLoadType type)
+ : ScheduledNavigation(0.0, nullptr, true, true), m_type(type) {}
+
+ FrameLoadType m_type;
};
class ScheduledPageBlock final : public ScheduledNavigation {
@@ -464,12 +470,12 @@ void NavigationScheduler::scheduleFormSubmission(Document* document,
mustReplaceCurrentItem(m_frame)));
}
-void NavigationScheduler::scheduleReload() {
+void NavigationScheduler::scheduleReload(FrameLoadType type) {
if (!shouldScheduleReload())
return;
if (m_frame->document()->url().isEmpty())
return;
- schedule(ScheduledReload::create());
+ schedule(ScheduledReload::create(type));
}
void NavigationScheduler::navigateTask() {

Powered by Google App Engine
This is Rietveld 408576698