[DIAL] Consider replacing WeakPtr usage in DialServiceImpl |
||||
Issue descriptionThere are a couple of places where WeakPtr is used for DialServiceImpl. (1) DialSockets are supplied with callbacks bound to WeakPtr of DialServiceImpl. Note that DialServiceImpl owns DialSockets. (2) On non-ChromeOS, we post a task to a blocking IO thread to call net::GetNetworkList, with the reply callback bound also using WeakPtr of DialServiceImpl. For (1) we should be able to use base::Unretained. For (2) we may be able to use a CancelableTaskTracker to replace WeakPtrs.
,
Jun 23 2017
,
Jul 18 2017
,
Jul 18 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/878612219980ebb53ba49207d0f12fc52ff443e6 commit 878612219980ebb53ba49207d0f12fc52ff443e6 Author: Derek Cheng <imcheng@chromium.org> Date: Tue Jul 18 20:44:42 2017 [DIAL] DialServiceImpl / DialSocket cleanups. - Replace 2 instances of WeakPtr usage in DialServiceImpl with a CancelableTaskTracker to track thread-hopping calls to obtain network interfaces. - Replace the callbacks bound to DialServiceImpl using WeakPtr passed to DialSocket with a raw pointer DialServiceImpl. This is safe because DialServiceImpl owns DialSockets. - Remove WeakPtrFactory from DialServiceImpl. Bug: 735590 Change-Id: I4965a33a7a706b057ee7d0f4c5cb6fb98b06dbc2 Reviewed-on: https://chromium-review.googlesource.com/574993 Reviewed-by: Takumi Fujimoto <takumif@chromium.org> Commit-Queue: Derek Cheng <imcheng@chromium.org> Cr-Commit-Position: refs/heads/master@{#487595} [modify] https://crrev.com/878612219980ebb53ba49207d0f12fc52ff443e6/chrome/browser/media/router/discovery/dial/dial_service.cc [modify] https://crrev.com/878612219980ebb53ba49207d0f12fc52ff443e6/chrome/browser/media/router/discovery/dial/dial_service.h [modify] https://crrev.com/878612219980ebb53ba49207d0f12fc52ff443e6/chrome/browser/media/router/discovery/dial/dial_service_unittest.cc
,
Jul 18 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by sko...@chromium.org
, Jun 23 2017