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

Side by Side Diff: third_party/WebKit/Source/core/frame/Location.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) 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 20 matching lines...) Expand all
31 #include "bindings/core/v8/BindingSecurity.h" 31 #include "bindings/core/v8/BindingSecurity.h"
32 #include "bindings/core/v8/ExceptionState.h" 32 #include "bindings/core/v8/ExceptionState.h"
33 #include "bindings/core/v8/V8DOMActivityLogger.h" 33 #include "bindings/core/v8/V8DOMActivityLogger.h"
34 #include "core/dom/DOMURLUtilsReadOnly.h" 34 #include "core/dom/DOMURLUtilsReadOnly.h"
35 #include "core/dom/Document.h" 35 #include "core/dom/Document.h"
36 #include "core/dom/ExceptionCode.h" 36 #include "core/dom/ExceptionCode.h"
37 #include "core/frame/DOMWindow.h" 37 #include "core/frame/DOMWindow.h"
38 #include "core/frame/LocalDOMWindow.h" 38 #include "core/frame/LocalDOMWindow.h"
39 #include "core/frame/LocalFrame.h" 39 #include "core/frame/LocalFrame.h"
40 #include "core/loader/FrameLoader.h" 40 #include "core/loader/FrameLoader.h"
41 #include "platform/RuntimeEnabledFeatures.h"
41 #include "platform/weborigin/KURL.h" 42 #include "platform/weborigin/KURL.h"
42 #include "platform/weborigin/SecurityOrigin.h" 43 #include "platform/weborigin/SecurityOrigin.h"
43 44
44 namespace blink { 45 namespace blink {
45 46
46 Location::Location(DOMWindow* dom_window) : dom_window_(dom_window) {} 47 Location::Location(DOMWindow* dom_window) : dom_window_(dom_window) {}
47 48
48 DEFINE_TRACE(Location) { 49 DEFINE_TRACE(Location) {
49 visitor->Trace(dom_window_); 50 visitor->Trace(dom_window_);
50 } 51 }
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 ExceptionState& exception_state) { 220 ExceptionState& exception_state) {
220 SetLocation(url, current_window, entered_window, &exception_state, 221 SetLocation(url, current_window, entered_window, &exception_state,
221 SetLocationPolicy::kReplaceThisFrame); 222 SetLocationPolicy::kReplaceThisFrame);
222 } 223 }
223 224
224 void Location::reload(LocalDOMWindow* current_window) { 225 void Location::reload(LocalDOMWindow* current_window) {
225 if (!IsAttached()) 226 if (!IsAttached())
226 return; 227 return;
227 if (GetDocument()->Url().ProtocolIsJavaScript()) 228 if (GetDocument()->Url().ProtocolIsJavaScript())
228 return; 229 return;
229 dom_window_->GetFrame()->Reload(kFrameLoadTypeReload, 230 dom_window_->GetFrame()->Reload(
230 ClientRedirectPolicy::kClientRedirect); 231 RuntimeEnabledFeatures::locationHardReloadEnabled()
232 ? kFrameLoadTypeReloadBypassingCache
233 : kFrameLoadTypeReload,
234 ClientRedirectPolicy::kClientRedirect);
231 } 235 }
232 236
233 void Location::SetLocation(const String& url, 237 void Location::SetLocation(const String& url,
234 LocalDOMWindow* current_window, 238 LocalDOMWindow* current_window,
235 LocalDOMWindow* entered_window, 239 LocalDOMWindow* entered_window,
236 ExceptionState* exception_state, 240 ExceptionState* exception_state,
237 SetLocationPolicy set_location_policy) { 241 SetLocationPolicy set_location_policy) {
238 if (!IsAttached()) 242 if (!IsAttached())
239 return; 243 return;
240 244
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 289
286 Document* Location::GetDocument() const { 290 Document* Location::GetDocument() const {
287 return ToLocalDOMWindow(dom_window_)->document(); 291 return ToLocalDOMWindow(dom_window_)->document();
288 } 292 }
289 293
290 bool Location::IsAttached() const { 294 bool Location::IsAttached() const {
291 return dom_window_->GetFrame(); 295 return dom_window_->GetFrame();
292 } 296 }
293 297
294 } // namespace blink 298 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/core/loader/NavigationScheduler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698