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

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

Issue 2196333002: PlzNavigate: Clear provisional history item on redirects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@timing_api
Patch Set: Addressed comments (2) Created 4 years, 4 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 break; 202 break;
203 default: 203 default:
204 ASSERT_NOT_REACHED(); 204 ASSERT_NOT_REACHED();
205 } 205 }
206 206
207 if (resource) 207 if (resource)
208 fetcher()->preloadStarted(resource); 208 fetcher()->preloadStarted(resource);
209 return resource; 209 return resource;
210 } 210 }
211 211
212 void DocumentLoader::didRedirect(const KURL& oldURL, const KURL& newURL)
Nate Chapin 2016/08/17 23:45:52 Is there some redundant code between this and redi
arthursonzogni 2016/08/18 09:21:38 I tried to use didRedirect in redirectReceived. No
213 {
214 timing().addRedirect(oldURL, newURL);
215
216 // If a redirection happens during a back/forward navigation, don't restore
217 // any state from the old HistoryItem.
218 // There is a provisional history item for back/forward navigation only.
219 // In the other case, clearing it is a no-op.
220 DCHECK(frameLoader());
221 frameLoader()->discardProvisionalHistoryItem();
222 }
223
212 void DocumentLoader::dispatchLinkHeaderPreloads(ViewportDescriptionWrapper* view port, LinkLoader::MediaPreloadPolicy mediaPolicy) 224 void DocumentLoader::dispatchLinkHeaderPreloads(ViewportDescriptionWrapper* view port, LinkLoader::MediaPreloadPolicy mediaPolicy)
213 { 225 {
214 LinkLoader::loadLinksFromHeader(response().httpHeaderField(HTTPNames::Link), response().url(), m_frame->document(), NetworkHintsInterfaceImpl(), LinkLoader: :OnlyLoadResources, mediaPolicy, viewport); 226 LinkLoader::loadLinksFromHeader(response().httpHeaderField(HTTPNames::Link), response().url(), m_frame->document(), NetworkHintsInterfaceImpl(), LinkLoader: :OnlyLoadResources, mediaPolicy, viewport);
215 } 227 }
216 228
217 void DocumentLoader::didChangePerformanceTiming() 229 void DocumentLoader::didChangePerformanceTiming()
218 { 230 {
219 if (frame() && frame()->isMainFrame() && m_state >= Committed) { 231 if (frame() && frame()->isMainFrame() && m_state >= Committed) {
220 frameLoader()->client()->didChangePerformanceTiming(); 232 frameLoader()->client()->didChangePerformanceTiming();
221 } 233 }
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 { 730 {
719 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing); 731 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing);
720 if (!source.isNull()) 732 if (!source.isNull())
721 m_writer->appendReplacingData(source); 733 m_writer->appendReplacingData(source);
722 endWriting(m_writer.get()); 734 endWriting(m_writer.get());
723 } 735 }
724 736
725 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 737 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
726 738
727 } // namespace blink 739 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698