diff options
author | reillyg <reillyg@chromium.org> | 2015-02-09 12:18:33 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-09 20:19:19 +0000 |
commit | 9a77a7236aeab865e82dcb0baef21ab6e039cd2b (patch) | |
tree | 38b03be4cfb2ef13d1dbd94edda2350b8559f20d /base/observer_list_threadsafe.h | |
parent | c4f022a6bd3426307459d3773a0b86553d3efeea (diff) | |
download | chromium_src-9a77a7236aeab865e82dcb0baef21ab6e039cd2b.zip chromium_src-9a77a7236aeab865e82dcb0baef21ab6e039cd2b.tar.gz chromium_src-9a77a7236aeab865e82dcb0baef21ab6e039cd2b.tar.bz2 |
Pass FROM_HERE to ObserverListThreadSafe::Notify to improve profile.
ObserverListThreadSafe::Notify is the 4th most called function in a
profile generated on my host. This is because all tasks posted from it
are stamped with this callsite, providing very little information.
This patch forces callers to pass in their own tracking data so that
the profile will differentiate between each observer list holder.
TBR=garykac@chromium.org,rdsmith@chromium.org,stuartmorgan@chromium.org,gbillock@chromium.org
Review URL: https://codereview.chromium.org/877993003
Cr-Commit-Position: refs/heads/master@{#315372}
Diffstat (limited to 'base/observer_list_threadsafe.h')
-rw-r--r-- | base/observer_list_threadsafe.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h index b951a71..1a66333 100644 --- a/base/observer_list_threadsafe.h +++ b/base/observer_list_threadsafe.h @@ -168,7 +168,9 @@ class ObserverListThreadSafe // that at the completion of the Notify call that all Observers have // been Notified. The notification may still be pending delivery. template <class Method, class... Params> - void Notify(Method m, const Params&... params) { + void Notify(const tracked_objects::Location& from_here, + Method m, + const Params&... params) { UnboundMethod<ObserverType, Method, Tuple<Params...>> method( m, MakeTuple(params...)); @@ -176,7 +178,7 @@ class ObserverListThreadSafe for (const auto& entry : observer_lists_) { ObserverListContext* context = entry.second; context->loop->PostTask( - FROM_HERE, + from_here, base::Bind( &ObserverListThreadSafe<ObserverType>::template NotifyWrapper< Method, Tuple<Params...>>, |