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

Unified Diff: chrome/browser/extensions/event_router_forwarder.cc

Issue 1236493004: Final batch adding real histogram values for extension events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: android compile Created 5 years, 5 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
Index: chrome/browser/extensions/event_router_forwarder.cc
diff --git a/chrome/browser/extensions/event_router_forwarder.cc b/chrome/browser/extensions/event_router_forwarder.cc
index ccab45d96567fdc6b115e827d9d84d49fc79c50f..ff198a1eab0b01a37fcb5b39ebee48e62c035aa2 100644
--- a/chrome/browser/extensions/event_router_forwarder.cc
+++ b/chrome/browser/extensions/event_router_forwarder.cc
@@ -23,13 +23,16 @@ EventRouterForwarder::~EventRouterForwarder() {
}
void EventRouterForwarder::BroadcastEventToRenderers(
+ events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
const GURL& event_url) {
- HandleEvent(std::string(), event_name, event_args.Pass(), 0, true, event_url);
+ HandleEvent(std::string(), histogram_value, event_name, event_args.Pass(), 0,
+ true, event_url);
}
void EventRouterForwarder::DispatchEventToRenderers(
+ events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
void* profile,
@@ -37,24 +40,23 @@ void EventRouterForwarder::DispatchEventToRenderers(
const GURL& event_url) {
if (!profile)
return;
- HandleEvent(std::string(),
- event_name,
- event_args.Pass(),
- profile,
- use_profile_to_restrict_events,
- event_url);
+ HandleEvent(std::string(), histogram_value, event_name, event_args.Pass(),
+ profile, use_profile_to_restrict_events, event_url);
}
void EventRouterForwarder::BroadcastEventToExtension(
const std::string& extension_id,
+ events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
const GURL& event_url) {
- HandleEvent(extension_id, event_name, event_args.Pass(), 0, true, event_url);
+ HandleEvent(extension_id, histogram_value, event_name, event_args.Pass(), 0,
+ true, event_url);
}
void EventRouterForwarder::DispatchEventToExtension(
const std::string& extension_id,
+ events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
void* profile,
@@ -62,11 +64,12 @@ void EventRouterForwarder::DispatchEventToExtension(
const GURL& event_url) {
if (!profile)
return;
- HandleEvent(extension_id, event_name, event_args.Pass(), profile,
- use_profile_to_restrict_events, event_url);
+ HandleEvent(extension_id, histogram_value, event_name, event_args.Pass(),
+ profile, use_profile_to_restrict_events, event_url);
}
void EventRouterForwarder::HandleEvent(const std::string& extension_id,
+ events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
void* profile_ptr,
@@ -75,8 +78,8 @@ void EventRouterForwarder::HandleEvent(const std::string& extension_id,
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
- base::Bind(&EventRouterForwarder::HandleEvent, this,
- extension_id, event_name, base::Passed(&event_args),
+ base::Bind(&EventRouterForwarder::HandleEvent, this, extension_id,
+ histogram_value, event_name, base::Passed(&event_args),
profile_ptr, use_profile_to_restrict_events, event_url));
return;
}
@@ -92,16 +95,18 @@ void EventRouterForwarder::HandleEvent(const std::string& extension_id,
return;
}
if (profile) {
- CallEventRouter(profile, extension_id, event_name, event_args.Pass(),
+ CallEventRouter(profile, extension_id, histogram_value, event_name,
+ event_args.Pass(),
use_profile_to_restrict_events ? profile : NULL, event_url);
} else {
std::vector<Profile*> profiles(profile_manager->GetLoadedProfiles());
for (size_t i = 0; i < profiles.size(); ++i) {
scoped_ptr<base::ListValue> per_profile_event_args(
event_args->DeepCopy());
- CallEventRouter(
- profiles[i], extension_id, event_name, per_profile_event_args.Pass(),
- use_profile_to_restrict_events ? profiles[i] : NULL, event_url);
+ CallEventRouter(profiles[i], extension_id, histogram_value, event_name,
+ per_profile_event_args.Pass(),
+ use_profile_to_restrict_events ? profiles[i] : NULL,
+ event_url);
}
}
}
@@ -109,6 +114,7 @@ void EventRouterForwarder::HandleEvent(const std::string& extension_id,
void EventRouterForwarder::CallEventRouter(
Profile* profile,
const std::string& extension_id,
+ events::HistogramValue histogram_value,
const std::string& event_name,
scoped_ptr<base::ListValue> event_args,
Profile* restrict_to_profile,
@@ -122,7 +128,7 @@ void EventRouterForwarder::CallEventRouter(
#endif
scoped_ptr<Event> event(
- new Event(events::UNKNOWN, event_name, event_args.Pass()));
+ new Event(histogram_value, event_name, event_args.Pass()));
event->restrict_to_browser_context = restrict_to_profile;
event->event_url = event_url;
if (extension_id.empty()) {
« no previous file with comments | « chrome/browser/extensions/event_router_forwarder.h ('k') | chrome/browser/extensions/event_router_forwarder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698