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

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

Issue 2780953002: When historyEntryRequiresUserGesture is enabled, exempt docs that have been committed for 5 seconds (Closed)
Patch Set: Address ojan's comments Created 3 years, 8 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 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return HistoryInertCommit; 294 return HistoryInertCommit;
295 } 295 }
296 296
297 void DocumentLoader::updateForSameDocumentNavigation( 297 void DocumentLoader::updateForSameDocumentNavigation(
298 const KURL& newURL, 298 const KURL& newURL,
299 SameDocumentNavigationSource sameDocumentNavigationSource, 299 SameDocumentNavigationSource sameDocumentNavigationSource,
300 PassRefPtr<SerializedScriptValue> data, 300 PassRefPtr<SerializedScriptValue> data,
301 HistoryScrollRestorationType scrollRestorationType, 301 HistoryScrollRestorationType scrollRestorationType,
302 FrameLoadType type, 302 FrameLoadType type,
303 Document* initiatingDocument) { 303 Document* initiatingDocument) {
304 if (m_frame->settings()->getHistoryEntryRequiresUserGesture() && 304 if (initiatingDocument && !initiatingDocument->canCreateHistoryEntry())
305 initiatingDocument &&
306 !initiatingDocument->frame()->hasReceivedUserGesture()) {
307 type = FrameLoadTypeReplaceCurrentItem; 305 type = FrameLoadTypeReplaceCurrentItem;
308 }
309 306
310 KURL oldURL = m_request.url(); 307 KURL oldURL = m_request.url();
311 m_originalRequest.setURL(newURL); 308 m_originalRequest.setURL(newURL);
312 m_request.setURL(newURL); 309 m_request.setURL(newURL);
313 setReplacesCurrentHistoryItem(type != FrameLoadTypeStandard); 310 setReplacesCurrentHistoryItem(type != FrameLoadTypeStandard);
314 if (sameDocumentNavigationSource == SameDocumentNavigationHistoryApi) { 311 if (sameDocumentNavigationSource == SameDocumentNavigationHistoryApi) {
315 m_request.setHTTPMethod(HTTPNames::GET); 312 m_request.setHTTPMethod(HTTPNames::GET);
316 m_request.setHTTPBody(nullptr); 313 m_request.setHTTPBody(nullptr);
317 } 314 }
318 clearRedirectChain(); 315 clearRedirectChain();
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 InstallNewDocumentReason::kJavascriptURL, 1079 InstallNewDocumentReason::kJavascriptURL,
1083 ForceSynchronousParsing, KURL()); 1080 ForceSynchronousParsing, KURL());
1084 if (!source.isNull()) 1081 if (!source.isNull())
1085 m_writer->appendReplacingData(source); 1082 m_writer->appendReplacingData(source);
1086 endWriting(); 1083 endWriting();
1087 } 1084 }
1088 1085
1089 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 1086 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
1090 1087
1091 } // namespace blink 1088 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698