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

Issue 11451006: Make TabCapture requests use the target render process and render view id's for UI permissions. (Closed)

Created:
8 years ago by justinlin
Modified:
8 years ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, jam, darin-cc_chromium.org
Visibility:
Public.

Description

Make TabCapture requests use the target render process and render view id's for UI permissions. BUG=162097 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=172027

Patch Set 1 #

Patch Set 2 : Fix the bug too.. #

Total comments: 2

Patch Set 3 : review comments #

Total comments: 6

Patch Set 4 : Fix issues #

Patch Set 5 : Add a small comment #

Total comments: 4

Patch Set 6 : Early return in media_stream_impl instead. #

Total comments: 3

Patch Set 7 : Remove early return #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -75 lines) Patch
M chrome/browser/extensions/api/tab_capture/tab_capture_api.cc View 1 2 1 chunk +5 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/tab_capture/tab_capture_registry.h View 1 2 5 chunks +14 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc View 1 2 3 4 5 6 7 chunks +23 lines, -10 lines 0 comments Download
M chrome/browser/media/media_internals.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/media/media_internals.cc View 1 2 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/browser/media/media_internals_observer.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/media/media_stream_devices_controller.cc View 1 2 3 4 5 6 1 chunk +15 lines, -12 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host.cc View 1 2 3 4 6 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_manager.cc View 1 2 3 4 5 6 5 chunks +26 lines, -39 lines 2 comments Download
M content/browser/renderer_host/media/web_contents_capture_util.cc View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 18 (0 generated)
justinlin
Hi Shijing, these are the changes needed on top of your CL to keep TabCapture ...
8 years ago (2012-12-05 13:37:34 UTC) #1
no longer working on chromium
HI Justin, Please take a look at the comments. I think both ways work for ...
8 years ago (2012-12-05 17:38:37 UTC) #2
justinlin
Thanks Shijing, addressed the comments. aa@: PTAL as well, mostly just cleanup. On 2012/12/05 17:38:37, ...
8 years ago (2012-12-06 06:03:51 UTC) #3
justinlin
xians@: Note that I rebased off of master so I can land this separately. I ...
8 years ago (2012-12-06 06:05:13 UTC) #4
no longer working on chromium
Nice work. lgtm with some nits. https://codereview.chromium.org/11451006/diff/4/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc File chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc (right): https://codereview.chromium.org/11451006/diff/4/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc#newcode45 chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc:45: std::pair<int, int> id_pair ...
8 years ago (2012-12-07 14:13:10 UTC) #5
justinlin
Thanks for the review! Added small fix in media_stream_dispatcher_host.cc to remove a DCHECK and handle ...
8 years ago (2012-12-07 15:50:09 UTC) #6
no longer working on chromium
https://codereview.chromium.org/11451006/diff/12002/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://codereview.chromium.org/11451006/diff/12002/content/browser/renderer_host/media/media_stream_manager.cc#newcode255 content/browser/renderer_host/media/media_stream_manager.cc:255: bool has_valid_device_id = WebContentsCaptureUtil::ExtractTabCaptureTarget( How about doing an early ...
8 years ago (2012-12-07 15:56:39 UTC) #7
justinlin
https://codereview.chromium.org/11451006/diff/12002/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://codereview.chromium.org/11451006/diff/12002/content/browser/renderer_host/media/media_stream_manager.cc#newcode255 content/browser/renderer_host/media/media_stream_manager.cc:255: bool has_valid_device_id = WebContentsCaptureUtil::ExtractTabCaptureTarget( On 2012/12/07 15:56:39, xians1 wrote: ...
8 years ago (2012-12-07 15:59:52 UTC) #8
no longer working on chromium
https://codereview.chromium.org/11451006/diff/12002/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://codereview.chromium.org/11451006/diff/12002/content/browser/renderer_host/media/media_stream_manager.cc#newcode255 content/browser/renderer_host/media/media_stream_manager.cc:255: bool has_valid_device_id = WebContentsCaptureUtil::ExtractTabCaptureTarget( On 2012/12/07 15:59:53, justinlin wrote: ...
8 years ago (2012-12-07 16:06:06 UTC) #9
justinlin
Thanks Matt, did you want to take a look? https://codereview.chromium.org/11451006/diff/12002/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://codereview.chromium.org/11451006/diff/12002/content/browser/renderer_host/media/media_stream_manager.cc#newcode255 content/browser/renderer_host/media/media_stream_manager.cc:255: ...
8 years ago (2012-12-07 17:06:39 UTC) #10
Matt Perry
lgtm
8 years ago (2012-12-07 20:17:36 UTC) #11
wjia(left Chromium)
https://codereview.chromium.org/11451006/diff/18002/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://codereview.chromium.org/11451006/diff/18002/content/browser/renderer_host/media/media_stream_manager.cc#newcode266 content/browser/renderer_host/media/media_stream_manager.cc:266: return std::string(); drive by. I am wondering the consequence ...
8 years ago (2012-12-08 20:09:40 UTC) #12
justinlin
shijing/wjia ptal. Changed it back to a previous approach for media_stream_manager.cc. Small change that we ...
8 years ago (2012-12-08 23:30:27 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/justinlin@chromium.org/11451006/30001
8 years ago (2012-12-10 05:17:50 UTC) #14
wjia(left Chromium)
https://codereview.chromium.org/11451006/diff/30001/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://codereview.chromium.org/11451006/diff/30001/content/browser/renderer_host/media/media_stream_manager.cc#newcode278 content/browser/renderer_host/media/media_stream_manager.cc:278: base::Unretained(this), label)); In case of error, browser process should ...
8 years ago (2012-12-10 05:34:18 UTC) #15
commit-bot: I haz the power
Change committed as 172027
8 years ago (2012-12-10 08:53:06 UTC) #16
no longer working on chromium
https://chromiumcodereview.appspot.com/11451006/diff/18002/content/browser/renderer_host/media/media_stream_manager.cc File content/browser/renderer_host/media/media_stream_manager.cc (right): https://chromiumcodereview.appspot.com/11451006/diff/18002/content/browser/renderer_host/media/media_stream_manager.cc#newcode266 content/browser/renderer_host/media/media_stream_manager.cc:266: return std::string(); On 2012/12/08 23:30:27, justinlin wrote: > On ...
8 years ago (2012-12-10 10:03:18 UTC) #17
justinlin
8 years ago (2012-12-10 11:19:54 UTC) #18
Message was sent while issue was closed.
Thank you for the comments Wei and Shijing. I see the issue now. I thought
CancelRequest would cancel the request in media_stream_dispatcher_host and on
the renderer side too, but it doesn't.. This was a pre-existing issue then..
Nothing will leak (DeviceRequest is cleaned up in CancelRequest), but the
Request object in the dispatcher/dispatcher_host will be left dangling. They are
in lists of objects though, so they'll get cleaned up on destruction.
Sent a CL to fix this. Sorry for missing this..

On 2012/12/10 10:03:18, xians1 wrote:
>
https://chromiumcodereview.appspot.com/11451006/diff/18002/content/browser/re...
> File content/browser/renderer_host/media/media_stream_manager.cc (right):
> 
>
https://chromiumcodereview.appspot.com/11451006/diff/18002/content/browser/re...
> content/browser/renderer_host/media/media_stream_manager.cc:266: return
> std::string();
> On 2012/12/08 23:30:27, justinlin wrote:
> > On 2012/12/08 20:09:40, wjia wrote:
> > > drive by. I am wondering the consequence of returning an empty label. Even
> > > though MediaStreamDispatcherHost could be changed to allow empty label,
but
> > what
> > > about the requester in renderer process? Will it wait for some kind of
> > response
> > > from browser process for its request of GenerateStreamForDevice? If that's
> the
> > > case, MediaStreamDispatcherHost will never send a response to renderer
> process
> > > because it don't create a request at all.
> > > 
> > > So, shall we use NOTREACHER() or something else here?
> > 
> > Ah right. Actually, I just looked, and media_stream_dispatcher.cc stores a
> > Request object, so it expects a reply eventually, so we need to cancel the
> > request. I'll change it back to the original approach.
> > 
> > We can't put NOTREACHED() because it could end up in that branch through
user
> > input.
> 
> I am trying to understand more. Justin, what kind of reply does the
> dispatcher.cc expect? And does the render client use the label to cancel the
> request?
> 
>
https://chromiumcodereview.appspot.com/11451006/diff/30001/content/browser/re...
> File content/browser/renderer_host/media/media_stream_manager.cc (right):
> 
>
https://chromiumcodereview.appspot.com/11451006/diff/30001/content/browser/re...
> content/browser/renderer_host/media/media_stream_manager.cc:278:
> base::Unretained(this), label));
> On 2012/12/10 05:34:18, wjia wrote:
> > In case of error, browser process should send an error message to renderer
> > process, instead of just canceling the request. You can address this in a
> > separate patch.
> 
> +1, it seems to me we create a request here and does nothing.
> Please note that if the render client does not cancel the request, the request
> will leak.

Powered by Google App Engine
This is Rietveld 408576698