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

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 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::addExternalRedirect(const KURL& oldURL, const KURL& newURL)
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.
Charlie Reis 2016/08/11 21:05:01 It's probably worth mentioning that we only have a
arthursonzogni 2016/08/16 09:26:20 Done.
218 FrameLoader* frameloader = frameLoader();
Charlie Reis 2016/08/11 21:05:01 nit: No need to declare this. (If we did have it,
arthursonzogni 2016/08/16 09:26:20 Done.
219 if (frameloader)
Charlie Reis 2016/08/11 21:05:01 Is it possible for frameLoader() to return null he
arthursonzogni 2016/08/16 09:26:20 I am sure that where the function is called (in Re
220 frameloader->discardProvisionalHistoryItem();
221 }
222
212 void DocumentLoader::dispatchLinkHeaderPreloads(ViewportDescriptionWrapper* view port, LinkLoader::MediaPreloadPolicy mediaPolicy) 223 void DocumentLoader::dispatchLinkHeaderPreloads(ViewportDescriptionWrapper* view port, LinkLoader::MediaPreloadPolicy mediaPolicy)
213 { 224 {
214 LinkLoader::loadLinksFromHeader(response().httpHeaderField(HTTPNames::Link), response().url(), m_frame->document(), NetworkHintsInterfaceImpl(), LinkLoader: :OnlyLoadResources, mediaPolicy, viewport); 225 LinkLoader::loadLinksFromHeader(response().httpHeaderField(HTTPNames::Link), response().url(), m_frame->document(), NetworkHintsInterfaceImpl(), LinkLoader: :OnlyLoadResources, mediaPolicy, viewport);
215 } 226 }
216 227
217 void DocumentLoader::didChangePerformanceTiming() 228 void DocumentLoader::didChangePerformanceTiming()
218 { 229 {
219 if (frame() && frame()->isMainFrame() && m_state >= Committed) { 230 if (frame() && frame()->isMainFrame() && m_state >= Committed) {
220 frameLoader()->client()->didChangePerformanceTiming(); 231 frameLoader()->client()->didChangePerformanceTiming();
221 } 232 }
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 { 729 {
719 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing); 730 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing);
720 if (!source.isNull()) 731 if (!source.isNull())
721 m_writer->appendReplacingData(source); 732 m_writer->appendReplacingData(source);
722 endWriting(m_writer.get()); 733 endWriting(m_writer.get());
723 } 734 }
724 735
725 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 736 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
726 737
727 } // namespace blink 738 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698