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

Side by Side Diff: services/resource_coordinator/service_callbacks_impl.cc

Issue 2938443002: [GRC] UKM Support (Closed)
Patch Set: Address reviewer feedback 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 unified diff | Download patch
« no previous file with comments | « services/resource_coordinator/service_callbacks_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "services/resource_coordinator/service_callbacks_impl.h"
6
7 #include <utility>
8
9 #include "base/memory/ptr_util.h"
10 #include "components/ukm/public/mojo_ukm_recorder.h"
11 #include "services/resource_coordinator/resource_coordinator_service.h"
12 #include "services/service_manager/public/cpp/service_context_ref.h"
13
14 namespace resource_coordinator {
15
16 ServiceCallbacksImpl::ServiceCallbacksImpl(
17 service_manager::ServiceContextRefFactory* service_ref_factory,
18 ResourceCoordinatorService* resource_coordinator_service)
19 : resource_coordinator_service_(resource_coordinator_service) {
20 DCHECK(service_ref_factory);
21 service_ref_ = service_ref_factory->CreateRef();
22 }
23
24 ServiceCallbacksImpl::~ServiceCallbacksImpl() = default;
25
26 // static
27 void ServiceCallbacksImpl::Create(
28 service_manager::ServiceContextRefFactory* service_ref_factory,
29 ResourceCoordinatorService* resource_coordinator_service,
30 const service_manager::BindSourceInfo& source_info,
31 resource_coordinator::mojom::ServiceCallbacksRequest request) {
32 mojo::MakeStrongBinding(
33 base::MakeUnique<ServiceCallbacksImpl>(service_ref_factory,
34 resource_coordinator_service),
35 std::move(request));
36 }
37
38 void ServiceCallbacksImpl::SetUkmRecorderInterface(
39 ukm::mojom::UkmRecorderInterfacePtr ukm_recorder_interface) {
40 resource_coordinator_service_->SetUkmRecorder(
41 base::MakeUnique<ukm::MojoUkmRecorder>(
42 std::move(ukm_recorder_interface)));
43 }
44
45 void ServiceCallbacksImpl::IsUkmRecorderInterfaceInitialized(
46 const IsUkmRecorderInterfaceInitializedCallback& callback) {
47 callback.Run(resource_coordinator_service_->ukm_recorder() != nullptr);
48 }
49
50 } // namespace resource_coordinator
OLDNEW
« no previous file with comments | « services/resource_coordinator/service_callbacks_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698