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

Issue 517753002: Remove weak_ptr from CopresenceManager. (Closed)

Created:
6 years, 3 months ago by rkc
Modified:
6 years, 2 months ago
CC:
chromium-reviews, not at google - send to devlin
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Remove weak_ptr from CopresenceManager. The WhispernetClient object provided by the CopresenceDelegate passed to the CopresenceManager has a lifetime exceeding that of the CopresenceManager. We explicitly want to decouple their lifetimes since we may have lifetime restrictions imposed on WhispernetClient which may require it to outlive the CopresenceManager. For this reason, when passing a callback to the WhispernetClient from CopresenceManager, we were using a WeakPtr. This is unnecessary since the same can be accomplished by passing a CancelableCallback to the WhispernetClient and Canceling the callback in the CopresenceManager destructor. R=derat@chromium.org, willchan@chromium.org BUG=None. Committed: https://crrev.com/0e07df1bb2a7f00bf6430fe3a73d3f450e1ae3af Cr-Commit-Position: refs/heads/master@{#292772}

Patch Set 1 #

Total comments: 7

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -8 lines) Patch
M components/copresence/copresence_manager.cc View 1 chunk +8 lines, -5 lines 0 comments Download
M components/copresence/copresence_manager_impl.h View 1 3 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 14 (2 generated)
rkc
6 years, 3 months ago (2014-08-28 20:15:44 UTC) #1
Daniel Erat
https://codereview.chromium.org/517753002/diff/1/components/copresence/copresence_manager.cc File components/copresence/copresence_manager.cc (right): https://codereview.chromium.org/517753002/diff/1/components/copresence/copresence_manager.cc#newcode28 components/copresence/copresence_manager.cc:28: manager->init_callback_.Reset( i'm missing some background here, but what's the ...
6 years, 3 months ago (2014-08-28 21:32:41 UTC) #2
rkc
https://codereview.chromium.org/517753002/diff/1/components/copresence/copresence_manager.cc File components/copresence/copresence_manager.cc (right): https://codereview.chromium.org/517753002/diff/1/components/copresence/copresence_manager.cc#newcode28 components/copresence/copresence_manager.cc:28: manager->init_callback_.Reset( On 2014/08/28 21:32:41, Daniel Erat wrote: > i'm ...
6 years, 3 months ago (2014-08-28 21:51:50 UTC) #3
Daniel Erat
looks okay to me, although i'm not sure how this is appreciably different from using ...
6 years, 3 months ago (2014-08-28 22:54:04 UTC) #4
rkc
On 2014/08/28 22:54:04, Daniel Erat wrote: > looks okay to me, although i'm not sure ...
6 years, 3 months ago (2014-08-28 23:21:06 UTC) #5
willchan no longer on Chromium
Sorry, I don't have time to review :(
6 years, 3 months ago (2014-08-29 18:47:41 UTC) #6
Daniel Erat
lgtm
6 years, 3 months ago (2014-08-29 21:15:26 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rkc@chromium.org/517753002/20001
6 years, 3 months ago (2014-08-30 02:24:45 UTC) #9
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_tests_recipe on tryserver.chromium.linux ...
6 years, 3 months ago (2014-08-30 03:19:34 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001) as 952fcc4bfbb8a6369d8183384c7881fc5dad00cc
6 years, 3 months ago (2014-08-30 05:19:06 UTC) #11
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/0e07df1bb2a7f00bf6430fe3a73d3f450e1ae3af Cr-Commit-Position: refs/heads/master@{#292772}
6 years, 3 months ago (2014-09-10 03:13:44 UTC) #12
Charlie
6 years, 2 months ago (2014-10-17 22:18:10 UTC) #14
Message was sent while issue was closed.
Ben, can you clarify how you were thinking the Create() method should work?
derat@ points out that it's weird to have Foo::Create() doing all the internal
setup for FooImpl.

https://codereview.chromium.org/517753002/diff/1/components/copresence/copres...
File components/copresence/copresence_manager.cc (right):

https://codereview.chromium.org/517753002/diff/1/components/copresence/copres...
components/copresence/copresence_manager.cc:28: manager->init_callback_.Reset(
On 2014/08/28 21:51:50, Rahul Chaturvedi wrote:
> On 2014/08/28 21:32:41, Daniel Erat wrote:
> > i'm missing some background here, but what's the reason for this file? it
> seems
> > strange to have it accessing internals that are part of
CopresenceManagerImpl.
> 
> This was written by Charlie while I was OOO. I am fairly confused about this
> too, but since he is on paternity leave for a few weeks, I'm leaving the code
as
> is till he's back, assuming that he had a good reason to do this.

This was in response to kalman@'s suggestion:

https://codereview.chromium.org/441103002/diff/40001/components/copresence/pu...

But there may be a cleaner way to do this. One option is to keep the impl class
at file scope:

https://code.google.com/p/chromium/codesearch#chromium/src/chromeos/dbus/sms_...

Powered by Google App Engine
This is Rietveld 408576698