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

Issue 12179007: While screencasting a tab, do not disable rendering updates while hidden. (Closed)

Created:
7 years, 10 months ago by miu
Modified:
7 years, 10 months ago
Reviewers:
ncarter (slow), sky, Jói
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, dcheng, feature-media-reviews_chromium.org
Visibility:
Public.

Description

While screencasting a tab, do not disable rendering updates while hidden. Approach: There is already a mechanism in WebContentsImpl to prevent WasHidden() from bubbling down to RWHV during tab dragging. This mechanism is extended to also include the span of tab mirroring sessions. A counter is used to account for both dragging a tab and screencasting it at the same time. Fixed a bug in tab_drag_controller.cc where SetCapturingContents(false) was not being called after a drag in some circumstances. Note on GTK-specific drag controller change: WebContents::SetCapturingContents(true) is never called, making the Set(false) call a no-op. Removed the Set(false) call and confirmed this did not affect tab dragging behavior on Linux. BUG=154184 TEST=Win/Mac/Linux: Tested that hidden tabs continue to render with both GPU and software compositing paths. Also, ran through several tab dragging scenarios with and without screencasting engaged. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=180857

Patch Set 1 #

Patch Set 2 : Fixed calls to SetCapturingContents() on start/end of drag. #

Total comments: 6

Patch Set 3 : Comment for WebContents::SetCapturingContents() mentions counting. #

Total comments: 3

Patch Set 4 : Split SetCapturingContents into IncrementCapturerCount and DecrementCapturerCount methods. #

Patch Set 5 : Finer-grained increment/decrement, per sky@'s comments. #

Total comments: 3

Patch Set 6 : Execute delayed WasHidden() when capturer_count_ goes to zero. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+97 lines, -22 lines) Patch
M chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab_drag_controller.cc View 1 2 3 4 5 4 chunks +13 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/web_contents_video_capture_device.cc View 1 2 3 4 5 8 chunks +42 lines, -2 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 2 chunks +9 lines, -3 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 4 chunks +28 lines, -9 lines 0 comments Download
M content/public/browser/web_contents.h View 1 2 3 1 chunk +5 lines, -3 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
miu
Sky: Please review my changes to the tab drag controllers and WebContentsImpl. Nick: Please focus ...
7 years, 10 months ago (2013-02-02 23:30:55 UTC) #1
sky
I'm not familiar with web_contents_video_capture_device.cc. Make sure you get an OWNER to review it. https://codereview.chromium.org/12179007/diff/2001/chrome/browser/ui/views/tabs/tab_drag_controller.cc ...
7 years, 10 months ago (2013-02-04 15:02:25 UTC) #2
miu
Thanks, sky. Explanation below: https://codereview.chromium.org/12179007/diff/2001/chrome/browser/ui/views/tabs/tab_drag_controller.cc File chrome/browser/ui/views/tabs/tab_drag_controller.cc (right): https://codereview.chromium.org/12179007/diff/2001/chrome/browser/ui/views/tabs/tab_drag_controller.cc#newcode494 chrome/browser/ui/views/tabs/tab_drag_controller.cc:494: source_dragged_contents()->SetCapturingContents(true); On 2013/02/04 15:02:25, sky ...
7 years, 10 months ago (2013-02-04 21:36:52 UTC) #3
ncarter (slow)
WCVCD lgtm. One suggestion for web_contents_impl. https://codereview.chromium.org/12179007/diff/11001/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/12179007/diff/11001/content/browser/web_contents/web_contents_impl.cc#newcode1011 content/browser/web_contents/web_contents_impl.cc:1011: void WebContentsImpl::SetCapturingContents(bool cap) ...
7 years, 10 months ago (2013-02-04 22:13:43 UTC) #4
justinlin
https://codereview.chromium.org/12179007/diff/11001/content/browser/renderer_host/media/web_contents_video_capture_device.cc File content/browser/renderer_host/media/web_contents_video_capture_device.cc (right): https://codereview.chromium.org/12179007/diff/11001/content/browser/renderer_host/media/web_contents_video_capture_device.cc#newcode884 content/browser/renderer_host/media/web_contents_video_capture_device.cc:884: base::Bind(&CaptureMachine::DoShutdownTasksOnUIThread, this)); Drive-by: Hmm, couldn't this class get deleted ...
7 years, 10 months ago (2013-02-04 22:16:03 UTC) #5
miu
joi: Please review changes to content/public/browser/web_contents.h. All: After chatting with Nick, we decided to split ...
7 years, 10 months ago (2013-02-04 22:23:46 UTC) #6
miu
https://codereview.chromium.org/12179007/diff/11001/content/browser/renderer_host/media/web_contents_video_capture_device.cc File content/browser/renderer_host/media/web_contents_video_capture_device.cc (right): https://codereview.chromium.org/12179007/diff/11001/content/browser/renderer_host/media/web_contents_video_capture_device.cc#newcode884 content/browser/renderer_host/media/web_contents_video_capture_device.cc:884: base::Bind(&CaptureMachine::DoShutdownTasksOnUIThread, this)); On 2013/02/04 22:16:03, justinlin wrote: > Drive-by: ...
7 years, 10 months ago (2013-02-04 22:26:25 UTC) #7
sky
https://codereview.chromium.org/12179007/diff/2001/chrome/browser/ui/views/tabs/tab_drag_controller.cc File chrome/browser/ui/views/tabs/tab_drag_controller.cc (right): https://codereview.chromium.org/12179007/diff/2001/chrome/browser/ui/views/tabs/tab_drag_controller.cc#newcode494 chrome/browser/ui/views/tabs/tab_drag_controller.cc:494: source_dragged_contents()->SetCapturingContents(true); On 2013/02/04 21:36:52, Yuri wrote: > On 2013/02/04 ...
7 years, 10 months ago (2013-02-04 22:48:50 UTC) #8
miu
Thanks, sky. All changes as you requested. PTAL. https://codereview.chromium.org/12179007/diff/2001/chrome/browser/ui/views/tabs/tab_drag_controller.cc File chrome/browser/ui/views/tabs/tab_drag_controller.cc (right): https://codereview.chromium.org/12179007/diff/2001/chrome/browser/ui/views/tabs/tab_drag_controller.cc#newcode494 chrome/browser/ui/views/tabs/tab_drag_controller.cc:494: source_dragged_contents()->SetCapturingContents(true); ...
7 years, 10 months ago (2013-02-05 01:06:25 UTC) #9
sky
https://codereview.chromium.org/12179007/diff/10014/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc File chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc (left): https://codereview.chromium.org/12179007/diff/10014/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc#oldcode439 chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc:439: drag_data_->GetSourceWebContents()->SetCapturingContents(false); How come you don't need calls to increment/decrement ...
7 years, 10 months ago (2013-02-05 01:43:19 UTC) #10
miu
On 2013/02/05 01:43:19, sky wrote: > How come you don't need calls to increment/decrement int ...
7 years, 10 months ago (2013-02-05 06:20:29 UTC) #11
Jói
content/public API change LGTM, but I have a question about the implementation. Cheers, Jói https://codereview.chromium.org/12179007/diff/10014/content/browser/web_contents/web_contents_impl.cc ...
7 years, 10 months ago (2013-02-05 12:49:47 UTC) #12
sky
Nuking NativeViewPhotobooth SGTM. -Scott On Mon, Feb 4, 2013 at 10:20 PM, <miu@chromium.org> wrote: > ...
7 years, 10 months ago (2013-02-05 16:28:56 UTC) #13
miu
https://codereview.chromium.org/12179007/diff/10014/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/12179007/diff/10014/content/browser/web_contents/web_contents_impl.cc#newcode1100 content/browser/web_contents/web_contents_impl.cc:1100: rwhv->WasHidden(); On 2013/02/05 12:49:47, Jói wrote: > Should this ...
7 years, 10 months ago (2013-02-05 20:58:26 UTC) #14
sky
LGTM
7 years, 10 months ago (2013-02-05 21:35:57 UTC) #15
Jói
LGTM, thanks.
7 years, 10 months ago (2013-02-05 21:51:35 UTC) #16
miu
On 2013/02/05 16:28:56, sky wrote: > Nuking NativeViewPhotobooth SGTM. FYI--Filed bug http://crbug.com/174474 to follow-up on ...
7 years, 10 months ago (2013-02-05 22:51:12 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/miu@chromium.org/12179007/27001
7 years, 10 months ago (2013-02-05 22:53:38 UTC) #18
commit-bot: I haz the power
7 years, 10 months ago (2013-02-06 01:59:57 UTC) #19
Message was sent while issue was closed.
Change committed as 180857

Powered by Google App Engine
This is Rietveld 408576698