|
|
Created:
3 years, 7 months ago by ke.he Modified:
3 years, 6 months ago CC:
avayvod+watch_chromium.org, chromium-reviews, feature-media-reviews_chromium.org, imcheng+watch_chromium.org, isheriff+watch_chromium.org, jasonroberts+watch_google.com, mfoltz+watch_chromium.org, miu+watch_chromium.org, xjz+watch_chromium.org Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
DescriptionConvert CastTransportHostFilter to be client of wake lock service.
Wake Lock is a Mojo interface that wraps PowerSaveBlocker. As part of the
creation of standalone Device Service, all browser-side clients of
PowerSaveBlocker should be converted to be clients of the Wake Lock Mojo
interface instead.
BUG=689415
Review-Url: https://codereview.chromium.org/2891293002
Cr-Commit-Position: refs/heads/master@{#476172}
Committed: https://chromium.googlesource.com/chromium/src/+/b4fe4703234db95a75f7b94d1e97044d38488156
Patch Set 1 #
Total comments: 5
Patch Set 2 : Convert CastTransportHostFilter to be client of wake lock service. #Patch Set 3 : code rebaes #
Total comments: 2
Patch Set 4 : Uses BindConnectorRequest instead of ServiceManagerContext. #Patch Set 5 : Uses BindConnectorRequest instead of ServiceManagerContext. #
Total comments: 10
Patch Set 6 : Addressed Ken's review comments. #
Messages
Total messages: 62 (43 generated)
The CQ bit was checked by ke.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by ke.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
ke.he@intel.com changed reviewers: + sergeyu@chromium.org
Hi, Sergey, PTAL, thanks. https://codereview.chromium.org/2891293002/diff/1/chrome/browser/media/cast_t... File chrome/browser/media/cast_transport_host_filter.cc (right): https://codereview.chromium.org/2891293002/diff/1/chrome/browser/media/cast_t... chrome/browser/media/cast_transport_host_filter.cc:398: DCHECK_CURRENTLY_ON(content::BrowserThread::IO); It must runs on IO thread.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
sergeyu@chromium.org changed reviewers: + hubbe@chromium.org
Looks mostly good, but I'm not familiar with this file. +hubbe@ for the second pair for eyes. https://codereview.chromium.org/2891293002/diff/1/chrome/browser/media/cast_t... File chrome/browser/media/cast_transport_host_filter.cc (right): https://codereview.chromium.org/2891293002/diff/1/chrome/browser/media/cast_t... chrome/browser/media/cast_transport_host_filter.cc:159: has_wake_lock_ = true; I don't think we need this flag. RequestWakeLock() has no effect if the lock is active, so you could just always call it here. Also you could use !id_map.IsEmpty() to detect if the wake lock is already active.
Hi, Sergey, Thanks! Sorry to reply your comments lately. https://codereview.chromium.org/2891293002/diff/1/chrome/browser/media/cast_t... File chrome/browser/media/cast_transport_host_filter.cc (right): https://codereview.chromium.org/2891293002/diff/1/chrome/browser/media/cast_t... chrome/browser/media/cast_transport_host_filter.cc:159: has_wake_lock_ = true; On 2017/05/19 19:34:11, Sergey Ulanov wrote: > I don't think we need this flag. RequestWakeLock() has no effect if the lock is > active, so you could just always call it here. Also you could use > !id_map.IsEmpty() to detect if the wake lock is already active. Although sending extra RequestWakeLock() would be handled well in remote service side, I still feel it is better to make sure not to send extra RequestWakeLock(). And the "DVLOG(1)" would be output multiple times without the flag. WDYT? I'm OK to go with removing the flag if you think above operations are acceptable.
https://codereview.chromium.org/2891293002/diff/1/chrome/browser/media/cast_t... File chrome/browser/media/cast_transport_host_filter.cc (right): https://codereview.chromium.org/2891293002/diff/1/chrome/browser/media/cast_t... chrome/browser/media/cast_transport_host_filter.cc:159: has_wake_lock_ = true; On 2017/05/24 05:43:08, ke.he wrote: > On 2017/05/19 19:34:11, Sergey Ulanov wrote: > > I don't think we need this flag. RequestWakeLock() has no effect if the lock > is > > active, so you could just always call it here. Also you could use > > !id_map.IsEmpty() to detect if the wake lock is already active. > > Although sending extra RequestWakeLock() would be handled well in remote service > side, I still feel it is better to make sure not to send extra > RequestWakeLock(). And the "DVLOG(1)" would be output multiple times without the > flag. WDYT? > > I'm OK to go with removing the flag if you think above operations are > acceptable. > You can still avoid calling RequestWakeLock() again without the flag. if (id_map_.IsEmpty()) { GetWakeLockService()->RequestWakeLock(); } This will give you the same behavior as with the flag: Request wake_lock when a first stream is started and release it when the last stream is stopped.
The CQ bit was checked by ke.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-xco...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by ke.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by ke.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Thanks! PTAL. https://codereview.chromium.org/2891293002/diff/1/chrome/browser/media/cast_t... File chrome/browser/media/cast_transport_host_filter.cc (right): https://codereview.chromium.org/2891293002/diff/1/chrome/browser/media/cast_t... chrome/browser/media/cast_transport_host_filter.cc:159: has_wake_lock_ = true; On 2017/05/24 19:17:48, Sergey Ulanov wrote: > On 2017/05/24 05:43:08, ke.he wrote: > > On 2017/05/19 19:34:11, Sergey Ulanov wrote: > > > I don't think we need this flag. RequestWakeLock() has no effect if the lock > > is > > > active, so you could just always call it here. Also you could use > > > !id_map.IsEmpty() to detect if the wake lock is already active. > > > > Although sending extra RequestWakeLock() would be handled well in remote > service > > side, I still feel it is better to make sure not to send extra > > RequestWakeLock(). And the "DVLOG(1)" would be output multiple times without > the > > flag. WDYT? > > > > I'm OK to go with removing the flag if you think above operations are > > acceptable. > > > > You can still avoid calling RequestWakeLock() again without the flag. > > if (id_map_.IsEmpty()) { > GetWakeLockService()->RequestWakeLock(); > } > > > This will give you the same behavior as with the flag: Request wake_lock when a > first stream is started and release it when the last stream is stopped. Done. Thanks!
lgtm
The CQ bit was checked by ke.he@intel.com
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
ke.he@intel.com changed reviewers: + rockot@chromium.org
Hi, Ken, PTAL on //chrome/browser/media/DEPS. Thanks!
DEPS LGTM for device-related additions. Will need a content owner too
Wait, not LGTM. I didn't pay close enough attention. No, you cannot include stuff from content/browser from within chrome/. No exceptions.
lgtm https://codereview.chromium.org/2891293002/diff/40001/chrome/browser/media/ca... File chrome/browser/media/cast_transport_host_filter.cc (right): https://codereview.chromium.org/2891293002/diff/40001/chrome/browser/media/ca... chrome/browser/media/cast_transport_host_filter.cc:397: service_manager::Connector* connector = You don't need to use ServiceManagerContext for this (and you can't, anyway). A Connector can always be cloned, and can always bind other ConnectorRequests to the same impl. What you should do is create a new Connector here on the IO thread: service_manager::mojom::ConnectorRequest connector_request; auto connector = service_manager::Connector::Create(&connector_request); and then pass |connector_request| to the main thread where you can: content::ServiceManagerConnection::GetForProcess() ->GetConnector() ->BindConnectorRequest(std::move(connector_request));
On 2017/05/27 at 05:27:26, Ken Rockot(use gerrit already) wrote: > lgtm > > https://codereview.chromium.org/2891293002/diff/40001/chrome/browser/media/ca... > File chrome/browser/media/cast_transport_host_filter.cc (right): > > https://codereview.chromium.org/2891293002/diff/40001/chrome/browser/media/ca... > chrome/browser/media/cast_transport_host_filter.cc:397: service_manager::Connector* connector = > You don't need to use ServiceManagerContext for this (and you can't, anyway). > > A Connector can always be cloned, and can always bind other ConnectorRequests to the same impl. > > What you should do is create a new Connector here on the IO thread: > > service_manager::mojom::ConnectorRequest connector_request; > auto connector = service_manager::Connector::Create(&connector_request); > > and then pass |connector_request| to the main thread where you can: > > content::ServiceManagerConnection::GetForProcess() > ->GetConnector() > ->BindConnectorRequest(std::move(connector_request)); (that LG was not intentional... but i'll leave it alone. please make the change above :))
The CQ bit was checked by ke.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
Patchset #5 (id:80001) has been deleted
Patchset #5 (id:100001) has been deleted
The CQ bit was checked by ke.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Ken and Sergey, Thanks very much! PTAL again:) https://codereview.chromium.org/2891293002/diff/40001/chrome/browser/media/ca... File chrome/browser/media/cast_transport_host_filter.cc (right): https://codereview.chromium.org/2891293002/diff/40001/chrome/browser/media/ca... chrome/browser/media/cast_transport_host_filter.cc:397: service_manager::Connector* connector = On 2017/05/27 05:27:26, Ken Rockot(use gerrit already) wrote: > You don't need to use ServiceManagerContext for this (and you can't, anyway). > > A Connector can always be cloned, and can always bind other ConnectorRequests to > the same impl. > > What you should do is create a new Connector here on the IO thread: > > service_manager::mojom::ConnectorRequest connector_request; > auto connector = service_manager::Connector::Create(&connector_request); > > and then pass |connector_request| to the main thread where you can: > > content::ServiceManagerConnection::GetForProcess() > ->GetConnector() > ->BindConnectorRequest(std::move(connector_request)); Done. Thanks!
https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/DEPS File chrome/browser/media/DEPS (right): https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/D... chrome/browser/media/DEPS:2: "+content/public/common/service_manager_connection.h", this is not necessary - src/chrome already has full access to content/public/common https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/c... File chrome/browser/media/cast_transport_host_filter.h (right): https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/c... chrome/browser/media/cast_transport_host_filter.h:18: #include "content/public/common/service_manager_connection.h" Please move this include to the cc file, ServiceManagerConnection's definition is never used by this header https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/c... chrome/browser/media/cast_transport_host_filter.h:34: static void BindConnectorRequest( Please remove this from the class. It can be defined entirely within an anonymous namespace in the cc https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/c... chrome/browser/media/cast_transport_host_filter.h:104: // While |id_map_| is non-empty, request the WakeLockService to hold a wake How about "While |id_map_| is is non-empty, we use |wake_lock_| to request and hold a wake lock. If any wake lock is held upon destruction, it's implicitly canceled when this object is destroyed." IMHO no need to explain the implementation details of Mojo bindings or the service here. It may be best to document the service behavior in the mojom rather than at the site of each client's usage. https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/c... chrome/browser/media/cast_transport_host_filter.h:109: device::mojom::WakeLockServicePtr wake_lock_service_; super nit: can we please just call this |wake_lock_|? I would like to someday rename WakeLockService to WakeLock, as we should rid ourselves of the habit of calling interfaces "services"
The CQ bit was checked by ke.he@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Ken, Thanks very much. PTAL:) https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/DEPS File chrome/browser/media/DEPS (right): https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/D... chrome/browser/media/DEPS:2: "+content/public/common/service_manager_connection.h", On 2017/05/31 11:50:49, Ken Rockot(use gerrit already) wrote: > this is not necessary - src/chrome already has full access to > content/public/common Done. https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/c... File chrome/browser/media/cast_transport_host_filter.h (right): https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/c... chrome/browser/media/cast_transport_host_filter.h:18: #include "content/public/common/service_manager_connection.h" On 2017/05/31 11:50:49, Ken Rockot(use gerrit already) wrote: > Please move this include to the cc file, ServiceManagerConnection's definition > is never used by this header Done. https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/c... chrome/browser/media/cast_transport_host_filter.h:34: static void BindConnectorRequest( On 2017/05/31 11:50:49, Ken Rockot(use gerrit already) wrote: > Please remove this from the class. It can be defined entirely within an > anonymous namespace in the cc Done. https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/c... chrome/browser/media/cast_transport_host_filter.h:104: // While |id_map_| is non-empty, request the WakeLockService to hold a wake On 2017/05/31 11:50:49, Ken Rockot(use gerrit already) wrote: > How about "While |id_map_| is is non-empty, we use |wake_lock_| to request and > hold a wake lock. If any wake lock is held upon destruction, it's implicitly > canceled when this object is destroyed." > > IMHO no need to explain the implementation details of Mojo bindings or the > service here. It may be best to document the service behavior in the mojom > rather than at the site of each client's usage. Done. https://codereview.chromium.org/2891293002/diff/120001/chrome/browser/media/c... chrome/browser/media/cast_transport_host_filter.h:109: device::mojom::WakeLockServicePtr wake_lock_service_; On 2017/05/31 11:50:49, Ken Rockot(use gerrit already) wrote: > super nit: can we please just call this |wake_lock_|? Done. > I would like to someday rename WakeLockService to WakeLock, as we should rid > ourselves of the habit of calling interfaces "services" Yeah, I think we can do the rename when moving it to //services/device/, after all clients of wakelock be converted.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm
The CQ bit was checked by ke.he@intel.com
The patchset sent to the CQ was uploaded after l-g-t-m from sergeyu@chromium.org Link to the patchset: https://codereview.chromium.org/2891293002/#ps140001 (title: "Addressed Ken's review comments.")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 140001, "attempt_start_ts": 1496287374002320, "parent_rev": "1183b68ff2c6689a609c9abc9757b94e3a8953bb", "commit_rev": "b4fe4703234db95a75f7b94d1e97044d38488156"}
Message was sent while issue was closed.
Description was changed from ========== Convert CastTransportHostFilter to be client of wake lock service. Wake Lock is a Mojo interface that wraps PowerSaveBlocker. As part of the creation of standalone Device Service, all browser-side clients of PowerSaveBlocker should be converted to be clients of the Wake Lock Mojo interface instead. BUG=689415 ========== to ========== Convert CastTransportHostFilter to be client of wake lock service. Wake Lock is a Mojo interface that wraps PowerSaveBlocker. As part of the creation of standalone Device Service, all browser-side clients of PowerSaveBlocker should be converted to be clients of the Wake Lock Mojo interface instead. BUG=689415 Review-Url: https://codereview.chromium.org/2891293002 Cr-Commit-Position: refs/heads/master@{#476172} Committed: https://chromium.googlesource.com/chromium/src/+/b4fe4703234db95a75f7b94d1e97... ==========
Message was sent while issue was closed.
Committed patchset #6 (id:140001) as https://chromium.googlesource.com/chromium/src/+/b4fe4703234db95a75f7b94d1e97... |