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

Unified Diff: third_party/WebKit/Source/web/WebDataSourceImpl.cpp

Issue 2368883003: PlzNavigate: fix crash when updating redirect timing. (Closed)
Patch Set: Addressed Comment + rebase. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebDataSourceImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebDataSourceImpl.cpp b/third_party/WebKit/Source/web/WebDataSourceImpl.cpp
index ec112b418ed2d8fa4ba75bf80b808f2118039058..40276873e9c783464f314170b834f102f5e9cede 100644
--- a/third_party/WebKit/Source/web/WebDataSourceImpl.cpp
+++ b/third_party/WebKit/Source/web/WebDataSourceImpl.cpp
@@ -75,10 +75,14 @@ void WebDataSourceImpl::updateNavigation(
double redirectEndTime,
double fetchStartTime,
const WebVector<WebURL>& redirectChain) {
- for (size_t i = 0; i + 1 < redirectChain.size(); ++i)
- didRedirect(redirectChain[i], redirectChain[i + 1]);
- timing().setRedirectStart(redirectStartTime);
- timing().setRedirectEnd(redirectEndTime);
+ // Updates the redirection timing if there is at least one redirection
+ // (between two URLs).
+ if (redirectChain.size() >= 2) {
+ for (size_t i = 0; i + 1 < redirectChain.size(); ++i)
+ didRedirect(redirectChain[i], redirectChain[i + 1]);
+ timing().setRedirectStart(redirectStartTime);
+ timing().setRedirectEnd(redirectEndTime);
+ }
timing().setFetchStart(fetchStartTime);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/FlagExpectations/enable-browser-side-navigation ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698