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

Issue 2103733004: Set navigationStart correctly for all load types. (Closed)

Created:
4 years, 5 months ago by Alexander Semashko
Modified:
4 years, 3 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dglazkov+blink, eae+blinkwatch, gavinp+loader_chromium.org, jam, Nate Chapin, kinuko+watch, kinuko, loading-reviews_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, panicker, rwlbuis, sof, tyoshino+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Set navigationStart correctly for all load types. Currently for browser-initiated navigations the navigationStart recorded in the browser process is discarded for "non-standard" load types, e.g. history navigations and navigations with should_replace_current_entry flag set. As per the comments in code, this is done to prevent setting navigationStart before prompting to unload the previous document. Sadly it is quite wrong and only causes inconsistency in the meaning of navigationStart (what it means depends on load type, though the spec makes no distinctions between them). And still in same-process navigations with WebFrameLoadType::Standard we take the browser-provided navigationStart, then fire beforeunload (probably waiting for user action on the dialog) and keep the old timestamp as is. In this CL navigationStart is reset to Now() after calling a beforeunload handler. On the other hand, it is not reset for load types other than standard, if beforeunload have been called earlier or the frame being navigated contains just an untouched initial document (guaranteed to be empty). Committed: https://crrev.com/eacad60524fdf286eccc22ebc160385cda2ad99c Cr-Commit-Position: refs/heads/master@{#415431}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Address comments, add more tests. #

Total comments: 7

Patch Set 3 : Reset timestamp after calling dispatchBeforeUnloadEvent. #

Patch Set 4 : Check for 'did access initial document' flag instead of event listener presence. #

Patch Set 5 : Don't call beforeunload on empty frames. #

Total comments: 4

Patch Set 6 : Take flag value from FrameLoader. #

Patch Set 7 : Add comment, fix indent. #

Total comments: 10

Patch Set 8 : Address comments. #

Total comments: 2

Patch Set 9 : Rebase. #

Patch Set 10 : Store hasAccessedInitialDocument flag in RenderFrameImpl. #

Total comments: 22

Patch Set 11 : Address comments. #

Total comments: 2

Patch Set 12 : rebase #

Patch Set 13 : Simplify test. #

Patch Set 14 : Remove routing id related changes. #

Patch Set 15 : Update test. #

Patch Set 16 : rebase #

Patch Set 17 : Account for PlzNavigate. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -87 lines) Patch
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 9 chunks +32 lines, -29 lines 0 comments Download
M content/renderer/render_view_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 12 chunks +122 lines, -49 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector-protocol/timeline/timeline-dispatchEvent.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebFrameTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 84 (20 generated)
Alexander Semashko
PTAL. More tests are likely needed, but I'd like to see WDYT in general first. ...
4 years, 5 months ago (2016-06-28 12:29:28 UTC) #2
jochen (gone - plz use gerrit)
which part do you want me to review?
4 years, 5 months ago (2016-06-28 13:17:25 UTC) #3
Alexander Semashko
On 2016/06/28 13:17:25, jochen wrote: > which part do you want me to review? third_party/WebKit. ...
4 years, 5 months ago (2016-06-28 13:43:15 UTC) #4
Charlie Harrison
Thanks a lot for working on this and the general approach looks good to me. ...
4 years, 5 months ago (2016-06-28 14:01:43 UTC) #5
Alexander Semashko
https://codereview.chromium.org/2103733004/diff/1/content/renderer/render_view_browsertest.cc File content/renderer/render_view_browsertest.cc (right): https://codereview.chromium.org/2103733004/diff/1/content/renderer/render_view_browsertest.cc#newcode2057 content/renderer/render_view_browsertest.cc:2057: DocumentState* document_state = DocumentState::FromDataSource(ds); On 2016/06/28 14:01:43, csharrison wrote: ...
4 years, 5 months ago (2016-06-28 14:47:45 UTC) #6
Charlie Harrison
https://codereview.chromium.org/2103733004/diff/1/content/renderer/render_view_browsertest.cc File content/renderer/render_view_browsertest.cc (right): https://codereview.chromium.org/2103733004/diff/1/content/renderer/render_view_browsertest.cc#newcode2057 content/renderer/render_view_browsertest.cc:2057: DocumentState* document_state = DocumentState::FromDataSource(ds); On 2016/06/28 at 14:47:45, Alexander ...
4 years, 5 months ago (2016-06-28 15:54:15 UTC) #7
Alexander Semashko
I added more tests and updated the comment in WebFrameClient.h. My todo list for this ...
4 years, 5 months ago (2016-06-29 10:11:56 UTC) #8
clamy
Thanks! As explained in my comment below, I think the patch can be made a ...
4 years, 5 months ago (2016-06-29 11:15:27 UTC) #9
Alexander Semashko
https://codereview.chromium.org/2103733004/diff/20001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2103733004/diff/20001/content/renderer/render_frame_impl.cc#newcode3670 content/renderer/render_frame_impl.cc:3670: void RenderFrameImpl::didHandleOnBeforeUnloadEvent(bool eventListenerCalled) { On 2016/06/29 11:15:26, clamy wrote: ...
4 years, 5 months ago (2016-06-29 15:08:10 UTC) #10
clamy
https://codereview.chromium.org/2103733004/diff/20001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2103733004/diff/20001/content/renderer/render_frame_impl.cc#newcode3670 content/renderer/render_frame_impl.cc:3670: void RenderFrameImpl::didHandleOnBeforeUnloadEvent(bool eventListenerCalled) { On 2016/06/29 15:08:09, Alexander Semashko ...
4 years, 5 months ago (2016-06-29 15:23:13 UTC) #11
Alexander Semashko
https://codereview.chromium.org/2103733004/diff/20001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2103733004/diff/20001/content/renderer/render_frame_impl.cc#newcode3670 content/renderer/render_frame_impl.cc:3670: void RenderFrameImpl::didHandleOnBeforeUnloadEvent(bool eventListenerCalled) { On 2016/06/29 15:23:13, clamy wrote: ...
4 years, 5 months ago (2016-06-29 17:33:30 UTC) #12
clamy
https://codereview.chromium.org/2103733004/diff/20001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2103733004/diff/20001/content/renderer/render_frame_impl.cc#newcode3670 content/renderer/render_frame_impl.cc:3670: void RenderFrameImpl::didHandleOnBeforeUnloadEvent(bool eventListenerCalled) { On 2016/06/29 17:33:30, Alexander Semashko ...
4 years, 5 months ago (2016-06-30 09:59:49 UTC) #13
Alexander Semashko
https://codereview.chromium.org/2103733004/diff/20001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2103733004/diff/20001/content/renderer/render_frame_impl.cc#newcode3670 content/renderer/render_frame_impl.cc:3670: void RenderFrameImpl::didHandleOnBeforeUnloadEvent(bool eventListenerCalled) { On 2016/06/30 09:59:49, clamy wrote: ...
4 years, 5 months ago (2016-06-30 19:35:08 UTC) #14
Alexander Semashko
Returning back to this CL. I checked those problematic cases and it seems there are ...
4 years, 5 months ago (2016-07-08 18:16:55 UTC) #15
Alexander Semashko
Finally got the tests working. PTAL once more.
4 years, 5 months ago (2016-07-08 23:05:32 UTC) #16
Charlie Harrison
I will defer to clamy@ on the implementation but if you could, please update the ...
4 years, 5 months ago (2016-07-12 13:56:17 UTC) #17
Alexander Semashko
On 2016/07/12 13:56:17, csharrison wrote: > I will defer to clamy@ on the implementation but ...
4 years, 5 months ago (2016-07-12 16:14:33 UTC) #19
clamy
@creis, nasko: PTAL. I'm adding you to the review, since this is turning into determining ...
4 years, 5 months ago (2016-07-12 16:19:09 UTC) #21
Alexander Semashko
On 2016/07/12 16:19:09, clamy wrote: > @creis, nasko: PTAL. I'm adding you to the review, ...
4 years, 5 months ago (2016-07-12 16:36:36 UTC) #22
Charlie Reis
On 2016/07/12 16:36:36, Alexander Semashko wrote: > On 2016/07/12 16:19:09, clamy wrote: > > @creis, ...
4 years, 5 months ago (2016-07-12 21:27:55 UTC) #23
Alexander Semashko
On 2016/07/12 21:27:55, Charlie Reis wrote: > On 2016/07/12 16:36:36, Alexander Semashko wrote: > > ...
4 years, 5 months ago (2016-07-14 19:39:21 UTC) #24
nasko
https://codereview.chromium.org/2103733004/diff/80001/content/renderer/render_frame_impl.h File content/renderer/render_frame_impl.h (right): https://codereview.chromium.org/2103733004/diff/80001/content/renderer/render_frame_impl.h#newcode1114 content/renderer/render_frame_impl.h:1114: bool did_access_initial_document_; Why can't we just expose the bit ...
4 years, 5 months ago (2016-07-18 22:20:00 UTC) #25
Alexander Semashko
https://codereview.chromium.org/2103733004/diff/80001/content/renderer/render_frame_impl.h File content/renderer/render_frame_impl.h (right): https://codereview.chromium.org/2103733004/diff/80001/content/renderer/render_frame_impl.h#newcode1114 content/renderer/render_frame_impl.h:1114: bool did_access_initial_document_; On 2016/07/18 22:20:00, nasko wrote: > Why ...
4 years, 5 months ago (2016-07-19 10:59:07 UTC) #26
Alexander Semashko
Since this CL will quite likely affect navigation metrics (histograms) from users, as well as, ...
4 years, 5 months ago (2016-07-19 22:46:05 UTC) #27
Charlie Harrison
On 2016/07/19 22:46:05, Alexander Semashko wrote: > Since this CL will quite likely affect navigation ...
4 years, 5 months ago (2016-07-19 22:50:08 UTC) #28
nasko
On 2016/07/19 22:50:08, csharrison wrote: > On 2016/07/19 22:46:05, Alexander Semashko wrote: > > Since ...
4 years, 5 months ago (2016-07-19 23:58:28 UTC) #29
Alexander Semashko
On 2016/07/19 23:58:28, nasko wrote: > On 2016/07/19 22:50:08, csharrison wrote: > > On 2016/07/19 ...
4 years, 5 months ago (2016-07-20 13:12:46 UTC) #30
Bryan McQuade
On 2016/07/20 at 13:12:46, ahest wrote: > On 2016/07/19 23:58:28, nasko wrote: > > On ...
4 years, 5 months ago (2016-07-20 19:59:49 UTC) #31
clamy
Thanks! I'm happy with the code in render_frame_impl, a few questions on the tests. https://codereview.chromium.org/2103733004/diff/120001/content/public/test/mock_render_thread.h ...
4 years, 5 months ago (2016-07-21 11:52:44 UTC) #32
Alexander Semashko
https://codereview.chromium.org/2103733004/diff/120001/content/public/test/mock_render_thread.h File content/public/test/mock_render_thread.h (right): https://codereview.chromium.org/2103733004/diff/120001/content/public/test/mock_render_thread.h#newcode105 content/public/test/mock_render_thread.h:105: void set_new_window_main_frame_routing_id(int32_t id) { On 2016/07/21 11:52:44, clamy wrote: ...
4 years, 5 months ago (2016-07-21 14:00:22 UTC) #33
jochen (gone - plz use gerrit)
lgtm +dcheng fyi webkit lgtm
4 years, 4 months ago (2016-07-29 09:51:00 UTC) #35
dcheng
https://codereview.chromium.org/2103733004/diff/140001/third_party/WebKit/public/web/WebLocalFrame.h File third_party/WebKit/public/web/WebLocalFrame.h (right): https://codereview.chromium.org/2103733004/diff/140001/third_party/WebKit/public/web/WebLocalFrame.h#newcode138 third_party/WebKit/public/web/WebLocalFrame.h:138: virtual bool hasAccessedInitialDocument() const = 0; Can't we just ...
4 years, 4 months ago (2016-07-29 12:50:54 UTC) #36
Alexander Semashko
https://codereview.chromium.org/2103733004/diff/140001/third_party/WebKit/public/web/WebLocalFrame.h File third_party/WebKit/public/web/WebLocalFrame.h (right): https://codereview.chromium.org/2103733004/diff/140001/third_party/WebKit/public/web/WebLocalFrame.h#newcode138 third_party/WebKit/public/web/WebLocalFrame.h:138: virtual bool hasAccessedInitialDocument() const = 0; On 2016/07/29 12:50:53, ...
4 years, 4 months ago (2016-08-12 09:26:35 UTC) #37
Alexander Semashko
dcheng, clamy, do you want anything else to be changed here?
4 years, 4 months ago (2016-08-16 21:21:09 UTC) #38
dcheng
blink lgtm
4 years, 4 months ago (2016-08-17 03:19:20 UTC) #39
clamy
Thanks! I'm happy with the code in RenderFrameImpl, some comments on the testing code. https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_frame_impl.cc ...
4 years, 4 months ago (2016-08-17 13:03:55 UTC) #40
Alexander Semashko
https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_frame_impl.cc#newcode5076 content/renderer/render_frame_impl.cc:5076: bool should_dispatch_before_unload = On 2016/08/17 13:03:55, clamy wrote: > ...
4 years, 4 months ago (2016-08-17 17:10:25 UTC) #41
Alexander Semashko
clamy, PTAL
4 years, 4 months ago (2016-08-19 07:47:40 UTC) #42
Alexander Semashko
clamy, friendly ping
4 years, 4 months ago (2016-08-24 09:33:35 UTC) #43
clamy
Thanks! https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc File content/renderer/render_view_browsertest.cc (right): https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc#newcode2061 content/renderer/render_view_browsertest.cc:2061: TEST_F(RenderViewImplTest, BrowserNavigationStart) { On 2016/08/17 17:10:25, Alexander Semashko ...
4 years, 4 months ago (2016-08-24 23:23:10 UTC) #44
Alexander Semashko
https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc File content/renderer/render_view_browsertest.cc (right): https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc#newcode2061 content/renderer/render_view_browsertest.cc:2061: TEST_F(RenderViewImplTest, BrowserNavigationStart) { On 2016/08/24 23:23:09, clamy wrote: > ...
4 years, 3 months ago (2016-08-25 10:44:33 UTC) #45
clamy
https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc File content/renderer/render_view_browsertest.cc (right): https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc#newcode2061 content/renderer/render_view_browsertest.cc:2061: TEST_F(RenderViewImplTest, BrowserNavigationStart) { On 2016/08/25 10:44:33, Alexander Semashko wrote: ...
4 years, 3 months ago (2016-08-25 18:00:15 UTC) #46
Alexander Semashko
https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc File content/renderer/render_view_browsertest.cc (right): https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc#newcode2061 content/renderer/render_view_browsertest.cc:2061: TEST_F(RenderViewImplTest, BrowserNavigationStart) { On 2016/08/25 18:00:14, clamy wrote: > ...
4 years, 3 months ago (2016-08-25 21:32:10 UTC) #47
clamy
https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc File content/renderer/render_view_browsertest.cc (right): https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc#newcode2061 content/renderer/render_view_browsertest.cc:2061: TEST_F(RenderViewImplTest, BrowserNavigationStart) { On 2016/08/25 21:32:10, Alexander Semashko wrote: ...
4 years, 3 months ago (2016-08-25 22:24:29 UTC) #48
Alexander Semashko
https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc File content/renderer/render_view_browsertest.cc (right): https://codereview.chromium.org/2103733004/diff/180001/content/renderer/render_view_browsertest.cc#newcode2061 content/renderer/render_view_browsertest.cc:2061: TEST_F(RenderViewImplTest, BrowserNavigationStart) { On 2016/08/25 22:24:29, clamy wrote: > ...
4 years, 3 months ago (2016-08-25 22:50:20 UTC) #49
clamy
Lgtm. Thanks for sticking through the long review process!
4 years, 3 months ago (2016-08-25 23:11:01 UTC) #50
Alexander Semashko
On 2016/08/25 23:11:01, clamy wrote: > Lgtm. Thanks for sticking through the long review process! ...
4 years, 3 months ago (2016-08-25 23:43:59 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2103733004/260001
4 years, 3 months ago (2016-08-25 23:47:39 UTC) #54
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/268048)
4 years, 3 months ago (2016-08-26 00:52:37 UTC) #56
Alexander Semashko
I had to change timeline-dispatchEvent a bit, since it was expecting that adding frame produces ...
4 years, 3 months ago (2016-08-29 16:18:20 UTC) #57
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2103733004/280001
4 years, 3 months ago (2016-08-29 16:22:06 UTC) #60
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/288254)
4 years, 3 months ago (2016-08-29 17:58:11 UTC) #62
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2103733004/280001
4 years, 3 months ago (2016-08-29 19:31:30 UTC) #64
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/288480) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 3 months ago (2016-08-30 03:17:05 UTC) #66
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2103733004/280001
4 years, 3 months ago (2016-08-30 09:43:11 UTC) #68
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/288871)
4 years, 3 months ago (2016-08-30 11:42:24 UTC) #70
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2103733004/280001
4 years, 3 months ago (2016-08-30 12:22:33 UTC) #72
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/288984)
4 years, 3 months ago (2016-08-30 15:18:24 UTC) #74
Alexander Semashko
I saw similar failures in a couple of other CLs, so was thinking it's just ...
4 years, 3 months ago (2016-08-30 16:35:14 UTC) #75
clamy
It seems you had an issue with the PlzNavigate run. Now that it fixed, I'll ...
4 years, 3 months ago (2016-08-30 18:40:36 UTC) #76
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2103733004/320001
4 years, 3 months ago (2016-08-30 18:41:25 UTC) #79
Alexander Semashko
On 2016/08/30 18:40:36, clamy wrote: > It seems you had an issue with the PlzNavigate ...
4 years, 3 months ago (2016-08-30 18:51:18 UTC) #80
commit-bot: I haz the power
Committed patchset #17 (id:320001)
4 years, 3 months ago (2016-08-30 21:26:12 UTC) #82
commit-bot: I haz the power
4 years, 3 months ago (2016-08-30 21:28:12 UTC) #84
Message was sent while issue was closed.
Patchset 17 (id:??) landed as
https://crrev.com/eacad60524fdf286eccc22ebc160385cda2ad99c
Cr-Commit-Position: refs/heads/master@{#415431}

Powered by Google App Engine
This is Rietveld 408576698