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

Side by Side Diff: third_party/WebKit/Source/core/loader/NavigationScheduler.cpp

Issue 2865013002: Add an experimental flag to change location.reload to take a hard-reload (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
5 * (http://www.torchmobile.com/) 5 * (http://www.torchmobile.com/)
6 * Copyright (C) 2009 Adam Barth. All rights reserved. 6 * Copyright (C) 2009 Adam Barth. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 }; 261 };
262 262
263 class ScheduledReload final : public ScheduledNavigation { 263 class ScheduledReload final : public ScheduledNavigation {
264 public: 264 public:
265 static ScheduledReload* Create() { return new ScheduledReload; } 265 static ScheduledReload* Create() { return new ScheduledReload; }
266 266
267 void Fire(LocalFrame* frame) override { 267 void Fire(LocalFrame* frame) override {
268 std::unique_ptr<UserGestureIndicator> gesture_indicator = 268 std::unique_ptr<UserGestureIndicator> gesture_indicator =
269 CreateUserGestureIndicator(); 269 CreateUserGestureIndicator();
270 ResourceRequest resource_request = frame->Loader().ResourceRequestForReload( 270 ResourceRequest resource_request = frame->Loader().ResourceRequestForReload(
271 kFrameLoadTypeReload, KURL(), ClientRedirectPolicy::kClientRedirect); 271 RuntimeEnabledFeatures::locationHardReloadEnabled()
272 ? kFrameLoadTypeReloadBypassingCache
273 : kFrameLoadTypeReload,
274 KURL(), ClientRedirectPolicy::kClientRedirect);
272 if (resource_request.IsNull()) 275 if (resource_request.IsNull())
273 return; 276 return;
274 FrameLoadRequest request = FrameLoadRequest(nullptr, resource_request); 277 FrameLoadRequest request = FrameLoadRequest(nullptr, resource_request);
275 request.SetClientRedirect(ClientRedirectPolicy::kClientRedirect); 278 request.SetClientRedirect(ClientRedirectPolicy::kClientRedirect);
276 MaybeLogScheduledNavigationClobber( 279 MaybeLogScheduledNavigationClobber(
277 ScheduledNavigationType::kScheduledReload, frame); 280 ScheduledNavigationType::kScheduledReload, frame);
278 frame->Loader().Load(request, kFrameLoadTypeReload); 281 frame->Loader().Load(request,
282 RuntimeEnabledFeatures::locationHardReloadEnabled()
283 ? kFrameLoadTypeReloadBypassingCache
284 : kFrameLoadTypeReload);
279 } 285 }
280 286
281 private: 287 private:
282 ScheduledReload() : ScheduledNavigation(0.0, nullptr, true, true) {} 288 ScheduledReload() : ScheduledNavigation(0.0, nullptr, true, true) {}
283 }; 289 };
284 290
285 class ScheduledPageBlock final : public ScheduledNavigation { 291 class ScheduledPageBlock final : public ScheduledNavigation {
286 public: 292 public:
287 static ScheduledPageBlock* Create(Document* origin_document, int reason) { 293 static ScheduledPageBlock* Create(Document* origin_document, int reason) {
288 return new ScheduledPageBlock(origin_document, reason); 294 return new ScheduledPageBlock(origin_document, reason);
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 navigate_task_handle_.Cancel(); 550 navigate_task_handle_.Cancel();
545 redirect_.Clear(); 551 redirect_.Clear();
546 } 552 }
547 553
548 DEFINE_TRACE(NavigationScheduler) { 554 DEFINE_TRACE(NavigationScheduler) {
549 visitor->Trace(frame_); 555 visitor->Trace(frame_);
550 visitor->Trace(redirect_); 556 visitor->Trace(redirect_);
551 } 557 }
552 558
553 } // namespace blink 559 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Location.cpp ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698