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

Issue 2291473002: Add a static getter for ChildMemoryCoordinator (Closed)

Created:
4 years, 3 months ago by bashi
Modified:
4 years, 3 months ago
Reviewers:
haraken, tasak
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a static getter for ChildMemoryCoordinator Currently ChildMemoryCoordinator is owned by RenderThreadImpl but some other components (like cc) would want to become clients of ChildMemoryCoordinator. Add a static getter to provide access to ChildMemoryCoordinator. BUG=617492 Committed: https://crrev.com/7056550d52a4e61bd120c24950d421fb0032dc55 Cr-Commit-Position: refs/heads/master@{#415212}

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -2 lines) Patch
M components/memory_coordinator/child/child_memory_coordinator_impl.h View 1 chunk +5 lines, -2 lines 0 comments Download
M components/memory_coordinator/child/child_memory_coordinator_impl.cc View 1 chunk +22 lines, -0 lines 3 comments Download

Messages

Total messages: 23 (10 generated)
bashi
PTAL Per request (https://codereview.chromium.org/2286583002/) https://codereview.chromium.org/2291473002/diff/1/components/memory_coordinator/child/child_memory_coordinator_impl.cc File components/memory_coordinator/child/child_memory_coordinator_impl.cc (right): https://codereview.chromium.org/2291473002/diff/1/components/memory_coordinator/child/child_memory_coordinator_impl.cc#newcode14 components/memory_coordinator/child/child_memory_coordinator_impl.cc:14: base::LazyInstance<base::Lock>::Leaky g_lock = LAZY_INSTANCE_INITIALIZER; Not ...
4 years, 3 months ago (2016-08-29 09:52:07 UTC) #4
tasak
Thank you, bashi-san. lgtm
4 years, 3 months ago (2016-08-29 09:56:09 UTC) #5
haraken
LGTM
4 years, 3 months ago (2016-08-29 10:00:37 UTC) #6
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/2291473002/1
4 years, 3 months ago (2016-08-29 10:03:07 UTC) #9
commit-bot: I haz the power
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_ng/builds/283150)
4 years, 3 months ago (2016-08-29 10:44:28 UTC) #11
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/2291473002/1
4 years, 3 months ago (2016-08-30 02:13:01 UTC) #13
commit-bot: I haz the power
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_ng/builds/283709)
4 years, 3 months ago (2016-08-30 03:42:52 UTC) #15
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/2291473002/1
4 years, 3 months ago (2016-08-30 04:40:15 UTC) #17
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 3 months ago (2016-08-30 06:18:23 UTC) #18
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/7056550d52a4e61bd120c24950d421fb0032dc55 Cr-Commit-Position: refs/heads/master@{#415212}
4 years, 3 months ago (2016-08-30 06:19:54 UTC) #20
haraken
https://codereview.chromium.org/2291473002/diff/1/components/memory_coordinator/child/child_memory_coordinator_impl.cc File components/memory_coordinator/child/child_memory_coordinator_impl.cc (right): https://codereview.chromium.org/2291473002/diff/1/components/memory_coordinator/child/child_memory_coordinator_impl.cc#newcode14 components/memory_coordinator/child/child_memory_coordinator_impl.cc:14: base::LazyInstance<base::Lock>::Leaky g_lock = LAZY_INSTANCE_INITIALIZER; On 2016/08/29 09:52:06, bashi1 wrote: ...
4 years, 3 months ago (2016-09-01 18:49:10 UTC) #21
bashi
https://codereview.chromium.org/2291473002/diff/1/components/memory_coordinator/child/child_memory_coordinator_impl.cc File components/memory_coordinator/child/child_memory_coordinator_impl.cc (right): https://codereview.chromium.org/2291473002/diff/1/components/memory_coordinator/child/child_memory_coordinator_impl.cc#newcode14 components/memory_coordinator/child/child_memory_coordinator_impl.cc:14: base::LazyInstance<base::Lock>::Leaky g_lock = LAZY_INSTANCE_INITIALIZER; On 2016/09/01 18:49:10, haraken wrote: ...
4 years, 3 months ago (2016-09-01 22:53:39 UTC) #22
haraken
4 years, 3 months ago (2016-09-01 23:20:29 UTC) #23
Message was sent while issue was closed.
On 2016/09/01 22:53:39, bashi1 wrote:
>
https://codereview.chromium.org/2291473002/diff/1/components/memory_coordinat...
> File components/memory_coordinator/child/child_memory_coordinator_impl.cc
> (right):
> 
>
https://codereview.chromium.org/2291473002/diff/1/components/memory_coordinat...
> components/memory_coordinator/child/child_memory_coordinator_impl.cc:14:
> base::LazyInstance<base::Lock>::Leaky g_lock = LAZY_INSTANCE_INITIALIZER;
> On 2016/09/01 18:49:10, haraken wrote:
> > On 2016/08/29 09:52:06, bashi1 wrote:
> > > Not sure we really need a lock. Can be removed when all callsites access
the
> > > getter only RenderTreadImpl is alive.
> > 
> > I begin to think that ChildMemoryCoordinator must be accessed only on the
main
> > thread. Calling RegisterClient/UnregisterClient on a non-main thread would
not
> > be a safe thing. Even if we make the registration/unregistration
thread-safe,
> > it's still not safe to call OnMemoryStateChange on a non-main thread.
> > 
> > So I think we should add DCHECK(isMainThread()) instead of adding a lock.
> > 
> 
> Making ChildMemoryCoordinator only accessible via the main thread seems fine
to
> me, but registerClient/unregisterClient is thread-safe now as we use
> base::ObserverListThreadSafe<MemoryCoordinatorClient>. OnStateChange() will be
> called on the thread registerClient() is called.
> 
> At this point I don't think we need DCHECK(isMainThread()).
> 
> If we want CMC be accessible only on the main thread, we need to provide a way
> to specify which thread OnStateChange() should be called.

Sorry, I was misunderstanding. Let's keep the current code as is -- it's clearly
better to support multi-threads in CMC :)

Powered by Google App Engine
This is Rietveld 408576698