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

Unified Diff: extensions/browser/event_router.cc

Issue 600213002: Instrumenting OnExtensionAddListener observer invocation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: brettw@ comment Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/profiler/scoped_profile.h ('k') | ipc/ipc_message_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/event_router.cc
diff --git a/extensions/browser/event_router.cc b/extensions/browser/event_router.cc
index d006d1e9a7588f049faf243e26c7097c71f47b25..d3fcc2d350da2dca136cc046b2fa792fea89e77a 100644
--- a/extensions/browser/event_router.cc
+++ b/extensions/browser/event_router.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/message_loop/message_loop.h"
+#include "base/profiler/scoped_profile.h"
#include "base/stl_util.h"
#include "base/values.h"
#include "content/public/browser/child_process_security_policy.h"
@@ -237,8 +238,13 @@ void EventRouter::OnListenerAdded(const EventListener* listener) {
listener->GetBrowserContext());
std::string base_event_name = GetBaseEventName(listener->event_name());
ObserverMap::iterator observer = observers_.find(base_event_name);
- if (observer != observers_.end())
+ if (observer != observers_.end()) {
+ // TODO(vadimt): Remove ScopedProfile below once crbug.com/417106 is fixed.
+ tracked_objects::ScopedProfile tracking_profile(
+ FROM_HERE_WITH_EXPLICIT_FUNCTION(
+ "EventRouter_OnListenerAdded_ObserverCall"));
observer->second->OnListenerAdded(details);
+ }
}
void EventRouter::OnListenerRemoved(const EventListener* listener) {
« no previous file with comments | « base/profiler/scoped_profile.h ('k') | ipc/ipc_message_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698