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

Issue 2702503003: [Dial] Refactor DialRegistry and DeviceDescriptionFetcher so they can be used by MediaSinkService (Closed)

Created:
3 years, 10 months ago by zhaobin
Modified:
3 years, 9 months ago
Reviewers:
mark a. foltz, imcheng
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Dial] Refactor DialRegistry and DeviceDescriptionFetcher so they can be used by MediaSinkService - Make DialRegistry listen to multiple observers (DialAPI and MediaSinkService) - Make DeviceDescriptionFetcher run on both UI (for extension functions) and IO (for MediaSinkService) threads BUG=687375 Review-Url: https://codereview.chromium.org/2702503003 Cr-Commit-Position: refs/heads/master@{#455192} Committed: https://chromium.googlesource.com/chromium/src/+/1b26f93c8009b26acc32161860c6dd1aac3d9818

Patch Set 1 #

Total comments: 13

Patch Set 2 : resolve code review comments from Derek and Mark #

Total comments: 9

Patch Set 3 : resolve code review comments from Derek #

Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -47 lines) Patch
M chrome/browser/extensions/api/dial/device_description_fetcher.h View 1 2 3 chunks +11 lines, -7 lines 0 comments Download
M chrome/browser/extensions/api/dial/device_description_fetcher.cc View 1 2 4 chunks +9 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/dial/device_description_fetcher_unittest.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/dial/dial_api.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/dial/dial_registry.h View 1 2 5 chunks +12 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/dial/dial_registry.cc View 1 2 8 chunks +38 lines, -20 lines 0 comments Download
M chrome/browser/extensions/api/dial/dial_registry_unittest.cc View 1 2 chunks +4 lines, -5 lines 0 comments Download

Messages

Total messages: 28 (18 generated)
zhaobin
3 years, 10 months ago (2017-02-16 18:33:15 UTC) #2
imcheng
https://codereview.chromium.org/2702503003/diff/1/chrome/browser/extensions/api/dial/device_description_fetcher.cc File chrome/browser/extensions/api/dial/device_description_fetcher.cc (right): https://codereview.chromium.org/2702503003/diff/1/chrome/browser/extensions/api/dial/device_description_fetcher.cc#newcode50 chrome/browser/extensions/api/dial/device_description_fetcher.cc:50: DCHECK_CURRENTLY_ON(thread_id_); If you are checking that the methods are ...
3 years, 10 months ago (2017-02-22 03:45:05 UTC) #3
mark a. foltz
https://codereview.chromium.org/2702503003/diff/1/chrome/browser/extensions/api/dial/device_description_fetcher.cc File chrome/browser/extensions/api/dial/device_description_fetcher.cc (right): https://codereview.chromium.org/2702503003/diff/1/chrome/browser/extensions/api/dial/device_description_fetcher.cc#newcode50 chrome/browser/extensions/api/dial/device_description_fetcher.cc:50: DCHECK_CURRENTLY_ON(thread_id_); On 2017/02/22 at 03:45:04, imcheng wrote: > If ...
3 years, 9 months ago (2017-03-01 21:44:00 UTC) #5
zhaobin
https://codereview.chromium.org/2702503003/diff/1/chrome/browser/extensions/api/dial/device_description_fetcher.cc File chrome/browser/extensions/api/dial/device_description_fetcher.cc (right): https://codereview.chromium.org/2702503003/diff/1/chrome/browser/extensions/api/dial/device_description_fetcher.cc#newcode50 chrome/browser/extensions/api/dial/device_description_fetcher.cc:50: DCHECK_CURRENTLY_ON(thread_id_); On 2017/03/01 21:44:00, mark a. foltz wrote: > ...
3 years, 9 months ago (2017-03-02 07:04:35 UTC) #6
mark a. foltz
lgtm
3 years, 9 months ago (2017-03-02 17:20:48 UTC) #7
imcheng
lgtm after comments addressed. https://codereview.chromium.org/2702503003/diff/40001/chrome/browser/extensions/api/dial/device_description_fetcher.cc File chrome/browser/extensions/api/dial/device_description_fetcher.cc (right): https://codereview.chromium.org/2702503003/diff/40001/chrome/browser/extensions/api/dial/device_description_fetcher.cc#newcode32 chrome/browser/extensions/api/dial/device_description_fetcher.cc:32: BrowserThread::ID thread_id, thread_id can be ...
3 years, 9 months ago (2017-03-06 20:56:30 UTC) #12
zhaobin
https://codereview.chromium.org/2702503003/diff/40001/chrome/browser/extensions/api/dial/device_description_fetcher.cc File chrome/browser/extensions/api/dial/device_description_fetcher.cc (right): https://codereview.chromium.org/2702503003/diff/40001/chrome/browser/extensions/api/dial/device_description_fetcher.cc#newcode32 chrome/browser/extensions/api/dial/device_description_fetcher.cc:32: BrowserThread::ID thread_id, On 2017/03/06 20:56:30, imcheng wrote: > thread_id ...
3 years, 9 months ago (2017-03-07 00:13:18 UTC) #13
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/2702503003/60001
3 years, 9 months ago (2017-03-07 20:05:05 UTC) #24
commit-bot: I haz the power
Committed patchset #3 (id:60001) as https://chromium.googlesource.com/chromium/src/+/1b26f93c8009b26acc32161860c6dd1aac3d9818
3 years, 9 months ago (2017-03-07 20:17:16 UTC) #27
imcheng
3 years, 9 months ago (2017-03-07 20:32:58 UTC) #28
Message was sent while issue was closed.
Sorry for the late comment, but it's fine to address in a follow up patch when
the refactored code is used in IO thread.

https://codereview.chromium.org/2702503003/diff/40001/chrome/browser/extensio...
File chrome/browser/extensions/api/dial/device_description_fetcher.h (right):

https://codereview.chromium.org/2702503003/diff/40001/chrome/browser/extensio...
chrome/browser/extensions/api/dial/device_description_fetcher.h:42:
net::URLRequestContextGetter* request_context,
On 2017/03/07 00:13:18, zhaobin wrote:
> On 2017/03/06 20:56:30, imcheng wrote:
> > I believe this should be a scoped_refptr; this object is passed from UI
thread
> > to IO thread. URLRequestContextGetter inherits RefCountedThreadSafe.
> 
> Pass in raw pointer (Profile::GetRequestContext() returns raw pointer) and
store
> it as scoped_refptr?

Most likely you will pass in a scoped_refptr here, but not a big deal until you
start to use this on the IO thread. The reason is that if this object is created
on the IO thread, then you would need to pass in a net::URLRequestContextGetter
from the UI thread first. This means it should already be wrapped in a
scoped_refptr when posting the task, since you can't pass in a raw pointer to a
ref counted type  as a function argument in base::Bind.

More info here:
https://www.chromium.org/developers/coding-style/important-abstractions-and-d...

Powered by Google App Engine
This is Rietveld 408576698