Index: services/resource_coordinator/public/interfaces/service_callbacks.mojom |
diff --git a/services/resource_coordinator/public/interfaces/service_callbacks.mojom b/services/resource_coordinator/public/interfaces/service_callbacks.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b319f101cbc4d7dc6391fd1523f38dd66cf019e7 |
--- /dev/null |
+++ b/services/resource_coordinator/public/interfaces/service_callbacks.mojom |
@@ -0,0 +1,27 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+module resource_coordinator.mojom; |
+ |
+import "components/ukm/public/interfaces/ukm_interface.mojom"; |
+ |
+// This class is intended to provide an interface to register mojo interfaces that |
dcheng
2017/06/23 16:10:35
mojo interfaces should still obey the 80 character
matthalp
2017/06/23 16:36:28
Done.
|
+// are not currently accessible to the resource_coordinator service. For example |
+// (and the reason for this interface), the UKM mojo interface is accessible to |
+// the resource_coordinator service code, as its in //components/, but it's bound |
+// within the content_browser service. Therefore, the content_browser service needs |
+// to bind to it and pass the message pointer (i.e. message pipe) to the |
+// resource_coordinator service. As a result, the ServiceCallbacks interface is |
+// strategically called within the content_browser service to pass in the |
+// initialized UkmRecorderInterfacePtr to the resource_coordinator service. |
+interface ServiceCallbacks { |
+ // Checks to see if the resource_coordinator service is already active. Any call to |
+ // EnsureUkmRecorderInterface should be enclosed in the callback and called only |
+ // when active == true to avoid creating an excessive number of UkmRecorderInterface |
+ // mojo connections as the resource_coordinator service will ignore the UkmRecorderInterface |
+ // passed into EnsureUkmRecorderInterface if it is already active. |
+ IsUkmRecorderInterfaceInitialized() => (bool ukm_recorder_already_initialized); |
+ |
+ SetUkmRecorderInterface(ukm.mojom.UkmRecorderInterface ukm_recorder_interface); |
+}; |