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

Issue 925623002: Refactor the loading tracking logic in WebContentsImpl. (Closed)

Created:
5 years, 10 months ago by Fabrice (no longer in Chrome)
Modified:
5 years, 9 months ago
CC:
chromium-reviews, darin-cc_chromium.org, nasko+codewatch_chromium.org, jam, creis+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor the loading tracking logic in WebContentsImpl. This removes the loading_progresses_ map and the loading_frames_in_progress counter in WebContentsImpl. Instead, tracking of these is done at the RFHI level. BUG=429399 Committed: https://crrev.com/bda82dd8f2286787212cb92c694a999f08834c7b Cr-Commit-Position: refs/heads/master@{#319267}

Patch Set 1 #

Total comments: 36

Patch Set 2 : Review comments #

Patch Set 3 : Fix compile #

Total comments: 6

Patch Set 4 : WIP (Fix tests) #

Total comments: 31

Patch Set 5 : WIP, just to run tests #

Total comments: 8

Patch Set 6 : Review comments + track per RFH #

Total comments: 9

Patch Set 7 : Review comments + fix #

Total comments: 8

Patch Set 8 : Review comments + add test #

Total comments: 6

Patch Set 9 : Rebase #

Total comments: 12

Patch Set 10 : Review comments #

Total comments: 26

Patch Set 11 : Review comments. #

Total comments: 12

Patch Set 12 : Review comments + rebase #

Total comments: 15

Patch Set 13 : Review comments #

Total comments: 16

Patch Set 14 : Review comments #

Patch Set 15 : Rebase #

Patch Set 16 : Comments consistency. #

Total comments: 6

Patch Set 17 : Nitses. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+202 lines, -87 lines) Patch
M content/browser/frame_host/frame_tree_node.h View 1 2 3 4 5 6 7 8 9 4 chunks +7 lines, -18 lines 0 comments Download
M content/browser/frame_host/frame_tree_node.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +23 lines, -2 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +36 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -8 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 10 chunks +66 lines, -59 lines 0 comments Download
M content/browser/web_contents/web_contents_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +64 lines, -0 lines 0 comments Download

Messages

Total messages: 50 (5 generated)
Fabrice (no longer in Chrome)
PTAL This is the first part of the Did{Start|Stop}Loading refactor, as discussed.
5 years, 10 months ago (2015-02-12 20:47:59 UTC) #2
Fabrice (no longer in Chrome)
5 years, 10 months ago (2015-02-12 23:53:25 UTC) #4
nasko
Just a couple of nits on a quick glimpse. The bigger issue is that this ...
5 years, 10 months ago (2015-02-13 00:16:29 UTC) #5
Charlie Reis
Thanks for taking this! I'm hopeful that this will fix some of the infinite spinner ...
5 years, 10 months ago (2015-02-13 01:01:52 UTC) #7
Charlie Reis
Also, for what it's worth, I had been experimenting with a test for the case ...
5 years, 10 months ago (2015-02-13 01:05:39 UTC) #8
clamy
Thanks! A few comments from my part. https://codereview.chromium.org/925623002/diff/1/content/browser/frame_host/frame_tree_node.h File content/browser/frame_host/frame_tree_node.h (right): https://codereview.chromium.org/925623002/diff/1/content/browser/frame_host/frame_tree_node.h#newcode118 content/browser/frame_host/frame_tree_node.h:118: double get_loading_progress() ...
5 years, 10 months ago (2015-02-13 12:13:43 UTC) #9
carlosk
Sorry for taking so long. https://codereview.chromium.org/925623002/diff/1/content/browser/frame_host/frame_tree_node.h File content/browser/frame_host/frame_tree_node.h (right): https://codereview.chromium.org/925623002/diff/1/content/browser/frame_host/frame_tree_node.h#newcode173 content/browser/frame_host/frame_tree_node.h:173: bool is_loading_; Does the ...
5 years, 10 months ago (2015-02-13 15:05:41 UTC) #10
Fabrice (no longer in Chrome)
Thanks a lot for the reviews everyone! Second patch set is WIP and I haven't ...
5 years, 10 months ago (2015-02-13 18:04:25 UTC) #11
carlosk
One extra explanation. https://codereview.chromium.org/925623002/diff/1/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/925623002/diff/1/content/browser/web_contents/web_contents_impl.cc#newcode176 content/browser/web_contents/web_contents_impl.cc:176: // Helper function to check if ...
5 years, 10 months ago (2015-02-16 11:40:21 UTC) #12
clamy
Thanks! A few comments on the new patchset. https://codereview.chromium.org/925623002/diff/1/content/browser/frame_host/frame_tree_node.h File content/browser/frame_host/frame_tree_node.h (right): https://codereview.chromium.org/925623002/diff/1/content/browser/frame_host/frame_tree_node.h#newcode118 content/browser/frame_host/frame_tree_node.h:118: double ...
5 years, 10 months ago (2015-02-16 14:20:59 UTC) #13
Fabrice (no longer in Chrome)
New WIP patch, should fix issues with currently failing tests. TODO: add a new test, ...
5 years, 10 months ago (2015-02-20 12:58:58 UTC) #14
clamy
Thanks! A few more comments. On a side note, it is harder to track what ...
5 years, 10 months ago (2015-02-20 14:00:24 UTC) #15
Charlie Reis
Thanks for the updates! A few additional comments and possible bugs below. https://codereview.chromium.org/925623002/diff/60001/content/browser/frame_host/frame_tree_node.cc File content/browser/frame_host/frame_tree_node.cc ...
5 years, 10 months ago (2015-02-20 23:42:13 UTC) #16
carlosk
Just a couple of comments to add. https://codereview.chromium.org/925623002/diff/60001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (left): https://codereview.chromium.org/925623002/diff/60001/content/browser/web_contents/web_contents_impl.cc#oldcode3401 content/browser/web_contents/web_contents_impl.cc:3401: return; You ...
5 years, 10 months ago (2015-02-23 10:41:15 UTC) #17
nasko
Few comments. https://codereview.chromium.org/925623002/diff/80001/content/browser/frame_host/frame_tree_node.h File content/browser/frame_host/frame_tree_node.h (right): https://codereview.chromium.org/925623002/diff/80001/content/browser/frame_host/frame_tree_node.h#newcode191 content/browser/frame_host/frame_tree_node.h:191: // Double value representing the frame's completion ...
5 years, 10 months ago (2015-02-23 16:54:44 UTC) #18
Fabrice (no longer in Chrome)
Thanks for all the comments! Following offline discussion with nasko@, I have moved the loading ...
5 years, 10 months ago (2015-02-23 20:02:07 UTC) #19
Fabrice (no longer in Chrome)
https://codereview.chromium.org/925623002/diff/100001/content/browser/frame_host/frame_tree_node.cc File content/browser/frame_host/frame_tree_node.cc (right): https://codereview.chromium.org/925623002/diff/100001/content/browser/frame_host/frame_tree_node.cc#newcode125 content/browser/frame_host/frame_tree_node.cc:125: return current_frame_host->is_loading() && pending_frame_host->is_loading(); ... s/&&/||/ I find it ...
5 years, 10 months ago (2015-02-23 20:48:45 UTC) #20
Charlie Reis
Hmm, why were loading and load progress moved from FrameTreeNode to RenderFrameHost? That seems confusing ...
5 years, 10 months ago (2015-02-24 04:55:00 UTC) #21
Fabrice (no longer in Chrome)
New patch, answering more older comments below. On 2015/02/24 04:55:00, Charlie Reis wrote: > Hmm, ...
5 years, 10 months ago (2015-02-24 13:14:47 UTC) #22
clamy
Thanks! Please find a few comments below. @creis: we discussed that with Nasko yesterday. The ...
5 years, 10 months ago (2015-02-24 13:54:55 UTC) #23
Charlie Reis
On 2015/02/24 13:54:55, clamy wrote: > Thanks! Please find a few comments below. > @creis: ...
5 years, 10 months ago (2015-02-25 00:07:21 UTC) #24
Fabrice (no longer in Chrome)
New patch, I have added a new unit test that covers all the cases where ...
5 years, 10 months ago (2015-02-26 13:44:12 UTC) #25
clamy
Thanks! A few more comments. https://codereview.chromium.org/925623002/diff/120001/content/browser/frame_host/render_frame_host_impl.h File content/browser/frame_host/render_frame_host_impl.h (right): https://codereview.chromium.org/925623002/diff/120001/content/browser/frame_host/render_frame_host_impl.h#newcode216 content/browser/frame_host/render_frame_host_impl.h:216: bool is_loading() const { ...
5 years, 10 months ago (2015-02-26 16:05:01 UTC) #26
nasko
Few more comments. https://codereview.chromium.org/925623002/diff/160001/content/browser/frame_host/frame_tree_node.h File content/browser/frame_host/frame_tree_node.h (right): https://codereview.chromium.org/925623002/diff/160001/content/browser/frame_host/frame_tree_node.h#newcode113 content/browser/frame_host/frame_tree_node.h:113: // Returns true if either the ...
5 years, 10 months ago (2015-02-26 23:30:34 UTC) #27
Fabrice (no longer in Chrome)
Thanks again for the comments. I changed the loading tracking per clamy's suggestion and (I ...
5 years, 9 months ago (2015-02-27 17:45:26 UTC) #28
clamy
Thanks! A few more comments. https://codereview.chromium.org/925623002/diff/180001/content/browser/frame_host/frame_tree_node.cc File content/browser/frame_host/frame_tree_node.cc (right): https://codereview.chromium.org/925623002/diff/180001/content/browser/frame_host/frame_tree_node.cc#newcode124 content/browser/frame_host/frame_tree_node.cc:124: if (pending_frame_host != nullptr) ...
5 years, 9 months ago (2015-03-02 10:30:59 UTC) #29
carlosk
I have only a few minor comments for now. https://codereview.chromium.org/925623002/diff/1/content/browser/web_contents/web_contents_impl.h File content/browser/web_contents/web_contents_impl.h (right): https://codereview.chromium.org/925623002/diff/1/content/browser/web_contents/web_contents_impl.h#newcode970 content/browser/web_contents/web_contents_impl.h:970: ...
5 years, 9 months ago (2015-03-02 14:17:29 UTC) #30
Fabrice (no longer in Chrome)
Thanks a lot clamy for the offline help with the test! I think everything should ...
5 years, 9 months ago (2015-03-02 18:01:40 UTC) #31
nasko
The CL is looking good, but please run some tryjobs so we can have an ...
5 years, 9 months ago (2015-03-02 23:44:42 UTC) #32
Charlie Reis
This is much improved since I last looked-- thanks for the effort. Mainly style nits ...
5 years, 9 months ago (2015-03-03 06:32:23 UTC) #33
Fabrice (no longer in Chrome)
Thanks for the comments, try jobs are running. https://codereview.chromium.org/925623002/diff/200001/content/browser/frame_host/frame_tree_node.cc File content/browser/frame_host/frame_tree_node.cc (right): https://codereview.chromium.org/925623002/diff/200001/content/browser/frame_host/frame_tree_node.cc#newcode123 content/browser/frame_host/frame_tree_node.cc:123: DCHECK(current_frame_host ...
5 years, 9 months ago (2015-03-03 13:12:17 UTC) #34
carlosk
Almost there! https://codereview.chromium.org/925623002/diff/220001/content/browser/web_contents/web_contents_impl_unittest.cc File content/browser/web_contents/web_contents_impl_unittest.cc (right): https://codereview.chromium.org/925623002/diff/220001/content/browser/web_contents/web_contents_impl_unittest.cc#newcode2902 content/browser/web_contents/web_contents_impl_unittest.cc:2902: ASSERT_NE(pending_rfh, nullptr); In the lines of what ...
5 years, 9 months ago (2015-03-03 15:29:13 UTC) #35
Fabrice (no longer in Chrome)
Quick update on the try jobs, android_rel_tests_recipe is currently failing due to https://code.google.com/p/chromium/issues/detail?id=463436
5 years, 9 months ago (2015-03-03 16:46:20 UTC) #36
clamy
Thanks! A few more comments, besides teh ones from carlosk@. https://codereview.chromium.org/925623002/diff/220001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/925623002/diff/220001/content/browser/web_contents/web_contents_impl.cc#newcode3448 ...
5 years, 9 months ago (2015-03-03 17:01:09 UTC) #37
Fabrice (no longer in Chrome)
https://codereview.chromium.org/925623002/diff/220001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/925623002/diff/220001/content/browser/web_contents/web_contents_impl.cc#newcode3448 content/browser/web_contents/web_contents_impl.cc:3448: bool WebContentsImpl::IsFrameTreeLoading() { On 2015/03/03 17:01:09, clamy wrote: > ...
5 years, 9 months ago (2015-03-04 18:17:58 UTC) #38
clamy
Thanks! Lgtm, provided the ASSERT_NE in the tests are changed to ASSERT_FALSE. https://codereview.chromium.org/925623002/diff/220001/content/browser/web_contents/web_contents_impl_unittest.cc File content/browser/web_contents/web_contents_impl_unittest.cc ...
5 years, 9 months ago (2015-03-04 18:28:49 UTC) #39
Charlie Reis
Agreed on the EXPECT_FALSE(ptr) convention, which is widespread in content/. Otherwise LGTM with nits once ...
5 years, 9 months ago (2015-03-05 04:46:19 UTC) #40
Fabrice (no longer in Chrome)
Thanks folks, seems good now! clamy@, carlosk@, could you do a final sanity check before ...
5 years, 9 months ago (2015-03-05 12:37:43 UTC) #41
carlosk
LGTM
5 years, 9 months ago (2015-03-05 14:08:27 UTC) #42
nasko
LGTM with a couple of nits! https://codereview.chromium.org/925623002/diff/300001/content/browser/frame_host/render_frame_host_impl.h File content/browser/frame_host/render_frame_host_impl.h (right): https://codereview.chromium.org/925623002/diff/300001/content/browser/frame_host/render_frame_host_impl.h#newcode101 content/browser/frame_host/render_frame_host_impl.h:101: // IPCs are ...
5 years, 9 months ago (2015-03-05 14:29:24 UTC) #43
Fabrice (no longer in Chrome)
Thanks folks! https://codereview.chromium.org/925623002/diff/300001/content/browser/frame_host/render_frame_host_impl.h File content/browser/frame_host/render_frame_host_impl.h (right): https://codereview.chromium.org/925623002/diff/300001/content/browser/frame_host/render_frame_host_impl.h#newcode101 content/browser/frame_host/render_frame_host_impl.h:101: // IPCs are moved from WebContentsImpl to ...
5 years, 9 months ago (2015-03-05 14:48:16 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/925623002/320001
5 years, 9 months ago (2015-03-05 14:49:03 UTC) #47
commit-bot: I haz the power
Committed patchset #17 (id:320001)
5 years, 9 months ago (2015-03-05 17:00:19 UTC) #48
commit-bot: I haz the power
Patchset 17 (id:??) landed as https://crrev.com/bda82dd8f2286787212cb92c694a999f08834c7b Cr-Commit-Position: refs/heads/master@{#319267}
5 years, 9 months ago (2015-03-05 17:01:09 UTC) #49
tasak
5 years, 9 months ago (2015-03-06 03:54:14 UTC) #50
Message was sent while issue was closed.
A revert of this CL (patchset #17 id:320001) has been created in
https://codereview.chromium.org/983973002/ by tasak@google.com.

The reason for reverting is: This patch causes the following layout tests'
crashes:
- fast/loader/stateobjects/replacestate-in-onunload.html:

2921
2922      // This method should never be called when the frame is loading.
2923      DCHECK(!rfh->is_loading());
2924

#3  0x00007fffefece2d3 in content::WebContentsImpl::OnDidStartLoading (
    this=0x181e00571b20, to_different_document=false)
    at ../../content/browser/web_contents/web_contents_impl.cc:2923
#4  0x00007fffefefa3e7 in DispatchToMethodImpl<content::WebContentsImpl, void
(content::WebContentsImpl::*)(bool), bool, 0ul> (obj=0x181e00571b20, method=
    (void (content::WebContentsImpl::*)(content::WebContentsImpl * const, bool))
0x7fffefece170 <content::WebContentsImpl::OnDidStartLoading(bool)>, arg=...)
    at ../../base/tuple.h:246
#5  0x00007fffefefa335 in DispatchToMethod<content::WebContentsImpl, void
(content::WebContentsImpl::*)(bool), bool> (obj=0x181e00571b20, method=
    (void (content::WebContentsImpl::*)(content::WebContentsImpl * const, bool))
0x7fffefece170 <content::WebContentsImpl::OnDidStartLoading(bool)>, arg=...)
    at ../../base/tuple.h:253
#6  0x00007fffefee4bf7 in
FrameHostMsg_DidStartLoading::Dispatch<content::WebContentsImpl,
content::WebContentsImpl, void, void (content::WebContentsImpl::*)(bool)>
(msg=0x181e006fddd0, obj=0x181e00571b20, sender=0x181e00571b20, 
    parameter=0x0, func=

c.f.
https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.7%20%28d...
.

Powered by Google App Engine
This is Rietveld 408576698