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

Issue 1394383002: OOPIF: Send page-level focus messages to all processes rendering a page. (Closed)

Created:
5 years, 2 months ago by alexmos
Modified:
5 years, 2 months ago
Reviewers:
Charlie Reis, dcheng, nasko
CC:
chromium-reviews, jam, nasko+codewatch_chromium.org, creis+watch_chromium.org, darin-cc_chromium.org, site-isolation-reviews_chromium.org, kenrb
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

OOPIF: Send page-level focus messages to all processes rendering a page. Previously, when a window gains or loses focus (such as when alt-tabbing to/from it), page-level focus would only be updated in top-level frame's process. This caused issues when cross-process subframes checked page-level focus via FocusController::isFocused(), for example when processing keyboard events for input fields. This CL adds logic to replicate the focus update to processes created for cross-process frames. This is used to update the focus state inside each RenderView (has_focus_) as well as page()->focusController().isFocused() state in each process. Some discussion about this is at https://goo.gl/B9S5ou. Note that the isActive() bit (set by ViewMsg_SetActive) will probably need to be similarly replicated as well, but this will be done in a separate CL. BUG=530663, 339659 Committed: https://crrev.com/3fcd0cae4e0cdd067ef5d8a2f3bd1c3b12da3109 Cr-Commit-Position: refs/heads/master@{#355833}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : Fix test failures #

Patch Set 5 : Another test fix #

Total comments: 21

Patch Set 6 : Send one message per subframe process; address Charlie's comments. #

Patch Set 7 : Rebase #

Total comments: 12

Patch Set 8 : Fix Charlie's nits #

Total comments: 5

Patch Set 9 : Rebase #

Patch Set 10 : Move ReplicatePageFocus to FrameTree #

Total comments: 4

Patch Set 11 : Address Nasko's comments #

Patch Set 12 : Rebase #

Patch Set 13 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+188 lines, -0 lines) Patch
M content/browser/frame_host/frame_tree.h View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/frame_host/frame_tree.cc View 1 2 3 4 5 6 7 8 9 3 chunks +28 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +115 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_delegate.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +10 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 1 chunk +1 line, -0 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 1 chunk +10 lines, -0 lines 0 comments Download
M content/renderer/render_frame_proxy.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_frame_proxy.cc View 1 2 3 4 5 3 chunks +6 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 28 (7 generated)
alexmos
Charlie, can you please take a look? Ken, I've CC'ed you as well to see ...
5 years, 2 months ago (2015-10-09 20:23:30 UTC) #2
Charlie Reis
Hmm, I think I'm missing something. Why do all the widgets want to know the ...
5 years, 2 months ago (2015-10-09 21:21:51 UTC) #3
alexmos
On 2015/10/09 21:21:51, Charlie Reis (slow til 10-12) wrote: > Hmm, I think I'm missing ...
5 years, 2 months ago (2015-10-09 21:52:14 UTC) #4
Charlie Reis
Ah, ok. Should we be tracking that on Page (shared across all widgets) rather than ...
5 years, 2 months ago (2015-10-09 22:23:06 UTC) #5
alexmos
I wanted to do this but didn't, because each RenderWidget also has a has_focus_ bit, ...
5 years, 2 months ago (2015-10-09 22:54:42 UTC) #6
alexmos
On 2015/10/09 22:54:42, alexmos wrote: > I wanted to do this but didn't, because each ...
5 years, 2 months ago (2015-10-09 22:57:09 UTC) #7
Charlie Reis
[+dcheng] Hrm. It seems like we have too many classes keeping track of focus, each ...
5 years, 2 months ago (2015-10-09 23:40:33 UTC) #9
dcheng
On 2015/10/09 at 23:40:33, creis wrote: > [+dcheng] > > Hrm. It seems like we ...
5 years, 2 months ago (2015-10-12 17:37:44 UTC) #10
alexmos
Charlie/Daniel: please take another look. I switched to send one page focus message per process, ...
5 years, 2 months ago (2015-10-16 16:50:45 UTC) #11
Charlie Reis
LGTM, thanks! https://codereview.chromium.org/1394383002/diff/80001/content/browser/frame_host/render_frame_host_manager_unittest.cc File content/browser/frame_host/render_frame_host_manager_unittest.cc (right): https://codereview.chromium.org/1394383002/diff/80001/content/browser/frame_host/render_frame_host_manager_unittest.cc#newcode2492 content/browser/frame_host/render_frame_host_manager_unittest.cc:2492: auto verify_focus_messages = [this, host1, host2](bool enable_focus) ...
5 years, 2 months ago (2015-10-16 18:56:09 UTC) #12
nasko
Drive by comment. https://codereview.chromium.org/1394383002/diff/140001/content/browser/frame_host/render_frame_host_manager.cc File content/browser/frame_host/render_frame_host_manager.cc (right): https://codereview.chromium.org/1394383002/diff/140001/content/browser/frame_host/render_frame_host_manager.cc#newcode2005 content/browser/frame_host/render_frame_host_manager.cc:2005: void RenderFrameHostManager::ReplicatePageFocus(bool is_focused) { This doesn't ...
5 years, 2 months ago (2015-10-16 21:43:44 UTC) #14
nasko
https://codereview.chromium.org/1394383002/diff/140001/content/browser/frame_host/render_frame_host_manager.cc File content/browser/frame_host/render_frame_host_manager.cc (right): https://codereview.chromium.org/1394383002/diff/140001/content/browser/frame_host/render_frame_host_manager.cc#newcode2021 content/browser/frame_host/render_frame_host_manager.cc:2021: CHECK(proxy); No need to CHECK here, as it will ...
5 years, 2 months ago (2015-10-16 21:44:21 UTC) #15
Charlie Reis
https://codereview.chromium.org/1394383002/diff/140001/content/browser/frame_host/render_frame_host_manager.cc File content/browser/frame_host/render_frame_host_manager.cc (right): https://codereview.chromium.org/1394383002/diff/140001/content/browser/frame_host/render_frame_host_manager.cc#newcode2005 content/browser/frame_host/render_frame_host_manager.cc:2005: void RenderFrameHostManager::ReplicatePageFocus(bool is_focused) { On 2015/10/16 21:43:44, nasko (slow ...
5 years, 2 months ago (2015-10-16 22:03:26 UTC) #16
alexmos
Thanks! https://codereview.chromium.org/1394383002/diff/120001/content/browser/frame_host/render_frame_host_manager.cc File content/browser/frame_host/render_frame_host_manager.cc (right): https://codereview.chromium.org/1394383002/diff/120001/content/browser/frame_host/render_frame_host_manager.cc#newcode87 content/browser/frame_host/render_frame_host_manager.cc:87: bool CollectSiteInstances(std::set<SiteInstance*>* set, On 2015/10/16 18:56:09, Charlie Reis ...
5 years, 2 months ago (2015-10-16 22:56:06 UTC) #17
nasko
Just a couple of things. https://codereview.chromium.org/1394383002/diff/180001/content/browser/frame_host/render_frame_host_manager_unittest.cc File content/browser/frame_host/render_frame_host_manager_unittest.cc (right): https://codereview.chromium.org/1394383002/diff/180001/content/browser/frame_host/render_frame_host_manager_unittest.cc#newcode2484 content/browser/frame_host/render_frame_host_manager_unittest.cc:2484: // Check that when ...
5 years, 2 months ago (2015-10-16 23:06:30 UTC) #18
alexmos
https://codereview.chromium.org/1394383002/diff/180001/content/browser/frame_host/render_frame_host_manager_unittest.cc File content/browser/frame_host/render_frame_host_manager_unittest.cc (right): https://codereview.chromium.org/1394383002/diff/180001/content/browser/frame_host/render_frame_host_manager_unittest.cc#newcode2484 content/browser/frame_host/render_frame_host_manager_unittest.cc:2484: // Check that when a window is focused/blurred, the ...
5 years, 2 months ago (2015-10-16 23:23:30 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1394383002/230001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1394383002/230001
5 years, 2 months ago (2015-10-23 05:52:18 UTC) #21
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-10-23 09:41:18 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1394383002/230001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1394383002/230001
5 years, 2 months ago (2015-10-23 18:09:34 UTC) #26
commit-bot: I haz the power
Committed patchset #13 (id:230001)
5 years, 2 months ago (2015-10-23 18:18:40 UTC) #27
commit-bot: I haz the power
5 years, 2 months ago (2015-10-23 18:19:32 UTC) #28
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/3fcd0cae4e0cdd067ef5d8a2f3bd1c3b12da3109
Cr-Commit-Position: refs/heads/master@{#355833}

Powered by Google App Engine
This is Rietveld 408576698