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

Unified Diff: services/resource_coordinator/coordination_unit/coordination_unit_manager.cc

Issue 2938443002: [GRC] UKM Support (Closed)
Patch Set: Refactor Created 3 years, 6 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: services/resource_coordinator/coordination_unit/coordination_unit_manager.cc
diff --git a/services/resource_coordinator/coordination_unit/coordination_unit_manager.cc b/services/resource_coordinator/coordination_unit/coordination_unit_manager.cc
index 4eca58767eeb3174725d51177d10ad7b67428785..10e3f6aee83dd82897762094bfd43c73bf87c88b 100644
--- a/services/resource_coordinator/coordination_unit/coordination_unit_manager.cc
+++ b/services/resource_coordinator/coordination_unit/coordination_unit_manager.cc
@@ -6,9 +6,14 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "components/ukm/public/mojo_ukm_recorder.h"
+#include "components/ukm/public/ukm_recorder.h"
#include "services/resource_coordinator/coordination_unit/coordination_unit_provider_impl.h"
#include "services/service_manager/public/cpp/binder_registry.h"
-#include "services/service_manager/public/cpp/service_context.h"
+
+namespace ukm {
+class UkmEntryBuilder;
+} // namespace ukm
namespace resource_coordinator {
@@ -25,4 +30,16 @@ void CoordinationUnitManager::OnStart(
base::Unretained(service_ref_factory)));
}
+void CoordinationUnitManager::SetUkmRecorder(
oystein (OOO til 10th of July) 2017/06/22 20:27:02 inline this as set_ukm_recorder()
matthalp 2017/06/22 22:59:30 Done.
+ ukm::MojoUkmRecorder* ukm_recorder) {
+ ukm_recorder_ = ukm_recorder;
+}
+
+std::unique_ptr<ukm::UkmEntryBuilder>
+CoordinationUnitManager::CreateUkmEntryBuilder(const char* event_name) {
+ DCHECK(ukm_recorder_ != nullptr);
+ return ukm_recorder_->GetEntryBuilder(ukm::UkmRecorder::GetNewSourceID(),
+ event_name);
+}
+
} // namespace resource_coordinator

Powered by Google App Engine
This is Rietveld 408576698