| Index: mojo/dart/packages/mojo_services/lib/tracing/trace_provider_registry.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo_services/lib/mojo/media/audio_server.mojom.dart b/mojo/dart/packages/mojo_services/lib/tracing/trace_provider_registry.mojom.dart
|
| similarity index 52%
|
| copy from mojo/dart/packages/mojo_services/lib/mojo/media/audio_server.mojom.dart
|
| copy to mojo/dart/packages/mojo_services/lib/tracing/trace_provider_registry.mojom.dart
|
| index 02b8d64fe2f6e4ca34c3dcd49750b86883a9d660..7b918bcbbd389ac33adbc9212dffcf5b913a087a 100644
|
| --- a/mojo/dart/packages/mojo_services/lib/mojo/media/audio_server.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/tracing/trace_provider_registry.mojom.dart
|
| @@ -2,24 +2,24 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -library audio_server_mojom;
|
| +library trace_provider_registry_mojom;
|
| import 'dart:async';
|
| import 'package:mojo/bindings.dart' as bindings;
|
| import 'package:mojo/core.dart' as core;
|
| import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as service_describer;
|
| -import 'package:mojo_services/mojo/media/audio_track.mojom.dart' as audio_track_mojom;
|
| +import 'package:mojo_services/tracing/tracing.mojom.dart' as tracing_mojom;
|
|
|
|
|
|
|
| -class _AudioServerCreateTrackParams extends bindings.Struct {
|
| +class _TraceProviderRegistryRegisterTraceProviderParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| const bindings.StructDataHeader(16, 0)
|
| ];
|
| - Object track = null;
|
| + Object traceProvider = null;
|
|
|
| - _AudioServerCreateTrackParams() : super(kVersions.last.size);
|
| + _TraceProviderRegistryRegisterTraceProviderParams() : super(kVersions.last.size);
|
|
|
| - static _AudioServerCreateTrackParams deserialize(bindings.Message message) {
|
| + static _TraceProviderRegistryRegisterTraceProviderParams deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -28,11 +28,11 @@ class _AudioServerCreateTrackParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _AudioServerCreateTrackParams decode(bindings.Decoder decoder0) {
|
| + static _TraceProviderRegistryRegisterTraceProviderParams decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _AudioServerCreateTrackParams result = new _AudioServerCreateTrackParams();
|
| + _TraceProviderRegistryRegisterTraceProviderParams result = new _TraceProviderRegistryRegisterTraceProviderParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -54,7 +54,7 @@ class _AudioServerCreateTrackParams extends bindings.Struct {
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.track = decoder0.decodeInterfaceRequest(8, false, audio_track_mojom.AudioTrackStub.newFromEndpoint);
|
| + result.traceProvider = decoder0.decodeServiceInterface(8, false, tracing_mojom.TraceProviderProxy.newFromEndpoint);
|
| }
|
| return result;
|
| }
|
| @@ -62,17 +62,17 @@ class _AudioServerCreateTrackParams extends bindings.Struct {
|
| void encode(bindings.Encoder encoder) {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| try {
|
| - encoder0.encodeInterfaceRequest(track, 8, false);
|
| + encoder0.encodeInterface(traceProvider, 8, false);
|
| } on bindings.MojoCodecError catch(e) {
|
| e.message = "Error encountered while encoding field "
|
| - "track of struct _AudioServerCreateTrackParams: $e";
|
| + "traceProvider of struct _TraceProviderRegistryRegisterTraceProviderParams: $e";
|
| rethrow;
|
| }
|
| }
|
|
|
| String toString() {
|
| - return "_AudioServerCreateTrackParams("
|
| - "track: $track" ")";
|
| + return "_TraceProviderRegistryRegisterTraceProviderParams("
|
| + "traceProvider: $traceProvider" ")";
|
| }
|
|
|
| Map toJson() {
|
| @@ -81,9 +81,9 @@ class _AudioServerCreateTrackParams extends bindings.Struct {
|
| }
|
| }
|
|
|
| -const int _audioServerMethodCreateTrackName = 0;
|
| +const int _traceProviderRegistryMethodRegisterTraceProviderName = 0;
|
|
|
| -class _AudioServerServiceDescription implements service_describer.ServiceDescription {
|
| +class _TraceProviderRegistryServiceDescription implements service_describer.ServiceDescription {
|
| dynamic getTopLevelInterface([Function responseFactory]) =>
|
| responseFactory(null);
|
|
|
| @@ -94,29 +94,29 @@ class _AudioServerServiceDescription implements service_describer.ServiceDescrip
|
| responseFactory(null);
|
| }
|
|
|
| -abstract class AudioServer {
|
| - static const String serviceName = "mojo::media::AudioServer";
|
| - void createTrack(Object track);
|
| +abstract class TraceProviderRegistry {
|
| + static const String serviceName = "tracing.TraceProviderRegistry";
|
| + void registerTraceProvider(Object traceProvider);
|
| }
|
|
|
|
|
| -class _AudioServerProxyImpl extends bindings.Proxy {
|
| - _AudioServerProxyImpl.fromEndpoint(
|
| +class _TraceProviderRegistryProxyImpl extends bindings.Proxy {
|
| + _TraceProviderRegistryProxyImpl.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
|
|
|
| - _AudioServerProxyImpl.fromHandle(core.MojoHandle handle) :
|
| + _TraceProviderRegistryProxyImpl.fromHandle(core.MojoHandle handle) :
|
| super.fromHandle(handle);
|
|
|
| - _AudioServerProxyImpl.unbound() : super.unbound();
|
| + _TraceProviderRegistryProxyImpl.unbound() : super.unbound();
|
|
|
| - static _AudioServerProxyImpl newFromEndpoint(
|
| + static _TraceProviderRegistryProxyImpl newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For _AudioServerProxyImpl"));
|
| - return new _AudioServerProxyImpl.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For _TraceProviderRegistryProxyImpl"));
|
| + return new _TraceProviderRegistryProxyImpl.fromEndpoint(endpoint);
|
| }
|
|
|
| service_describer.ServiceDescription get serviceDescription =>
|
| - new _AudioServerServiceDescription();
|
| + new _TraceProviderRegistryServiceDescription();
|
|
|
| void handleResponse(bindings.ServiceMessage message) {
|
| switch (message.header.type) {
|
| @@ -129,65 +129,65 @@ class _AudioServerProxyImpl extends bindings.Proxy {
|
|
|
| String toString() {
|
| var superString = super.toString();
|
| - return "_AudioServerProxyImpl($superString)";
|
| + return "_TraceProviderRegistryProxyImpl($superString)";
|
| }
|
| }
|
|
|
|
|
| -class _AudioServerProxyCalls implements AudioServer {
|
| - _AudioServerProxyImpl _proxyImpl;
|
| +class _TraceProviderRegistryProxyCalls implements TraceProviderRegistry {
|
| + _TraceProviderRegistryProxyImpl _proxyImpl;
|
|
|
| - _AudioServerProxyCalls(this._proxyImpl);
|
| - void createTrack(Object track) {
|
| + _TraceProviderRegistryProxyCalls(this._proxyImpl);
|
| + void registerTraceProvider(Object traceProvider) {
|
| if (!_proxyImpl.isBound) {
|
| _proxyImpl.proxyError("The Proxy is closed.");
|
| return;
|
| }
|
| - var params = new _AudioServerCreateTrackParams();
|
| - params.track = track;
|
| - _proxyImpl.sendMessage(params, _audioServerMethodCreateTrackName);
|
| + var params = new _TraceProviderRegistryRegisterTraceProviderParams();
|
| + params.traceProvider = traceProvider;
|
| + _proxyImpl.sendMessage(params, _traceProviderRegistryMethodRegisterTraceProviderName);
|
| }
|
| }
|
|
|
|
|
| -class AudioServerProxy implements bindings.ProxyBase {
|
| +class TraceProviderRegistryProxy implements bindings.ProxyBase {
|
| final bindings.Proxy impl;
|
| - AudioServer ptr;
|
| + TraceProviderRegistry ptr;
|
|
|
| - AudioServerProxy(_AudioServerProxyImpl proxyImpl) :
|
| + TraceProviderRegistryProxy(_TraceProviderRegistryProxyImpl proxyImpl) :
|
| impl = proxyImpl,
|
| - ptr = new _AudioServerProxyCalls(proxyImpl);
|
| + ptr = new _TraceProviderRegistryProxyCalls(proxyImpl);
|
|
|
| - AudioServerProxy.fromEndpoint(
|
| + TraceProviderRegistryProxy.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) :
|
| - impl = new _AudioServerProxyImpl.fromEndpoint(endpoint) {
|
| - ptr = new _AudioServerProxyCalls(impl);
|
| + impl = new _TraceProviderRegistryProxyImpl.fromEndpoint(endpoint) {
|
| + ptr = new _TraceProviderRegistryProxyCalls(impl);
|
| }
|
|
|
| - AudioServerProxy.fromHandle(core.MojoHandle handle) :
|
| - impl = new _AudioServerProxyImpl.fromHandle(handle) {
|
| - ptr = new _AudioServerProxyCalls(impl);
|
| + TraceProviderRegistryProxy.fromHandle(core.MojoHandle handle) :
|
| + impl = new _TraceProviderRegistryProxyImpl.fromHandle(handle) {
|
| + ptr = new _TraceProviderRegistryProxyCalls(impl);
|
| }
|
|
|
| - AudioServerProxy.unbound() :
|
| - impl = new _AudioServerProxyImpl.unbound() {
|
| - ptr = new _AudioServerProxyCalls(impl);
|
| + TraceProviderRegistryProxy.unbound() :
|
| + impl = new _TraceProviderRegistryProxyImpl.unbound() {
|
| + ptr = new _TraceProviderRegistryProxyCalls(impl);
|
| }
|
|
|
| - factory AudioServerProxy.connectToService(
|
| + factory TraceProviderRegistryProxy.connectToService(
|
| bindings.ServiceConnector s, String url, [String serviceName]) {
|
| - AudioServerProxy p = new AudioServerProxy.unbound();
|
| + TraceProviderRegistryProxy p = new TraceProviderRegistryProxy.unbound();
|
| s.connectToService(url, p, serviceName);
|
| return p;
|
| }
|
|
|
| - static AudioServerProxy newFromEndpoint(
|
| + static TraceProviderRegistryProxy newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For AudioServerProxy"));
|
| - return new AudioServerProxy.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For TraceProviderRegistryProxy"));
|
| + return new TraceProviderRegistryProxy.fromEndpoint(endpoint);
|
| }
|
|
|
| - String get serviceName => AudioServer.serviceName;
|
| + String get serviceName => TraceProviderRegistry.serviceName;
|
|
|
| Future close({bool immediate: false}) => impl.close(immediate: immediate);
|
|
|
| @@ -204,27 +204,27 @@ class AudioServerProxy implements bindings.ProxyBase {
|
| }
|
|
|
| String toString() {
|
| - return "AudioServerProxy($impl)";
|
| + return "TraceProviderRegistryProxy($impl)";
|
| }
|
| }
|
|
|
|
|
| -class AudioServerStub extends bindings.Stub {
|
| - AudioServer _impl = null;
|
| +class TraceProviderRegistryStub extends bindings.Stub {
|
| + TraceProviderRegistry _impl = null;
|
|
|
| - AudioServerStub.fromEndpoint(
|
| + TraceProviderRegistryStub.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| : super.fromEndpoint(endpoint);
|
|
|
| - AudioServerStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| + TraceProviderRegistryStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| : super.fromHandle(handle);
|
|
|
| - AudioServerStub.unbound() : super.unbound();
|
| + TraceProviderRegistryStub.unbound() : super.unbound();
|
|
|
| - static AudioServerStub newFromEndpoint(
|
| + static TraceProviderRegistryStub newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For AudioServerStub"));
|
| - return new AudioServerStub.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For TraceProviderRegistryStub"));
|
| + return new TraceProviderRegistryStub.fromEndpoint(endpoint);
|
| }
|
|
|
|
|
| @@ -237,10 +237,10 @@ class AudioServerStub extends bindings.Stub {
|
| }
|
| assert(_impl != null);
|
| switch (message.header.type) {
|
| - case _audioServerMethodCreateTrackName:
|
| - var params = _AudioServerCreateTrackParams.deserialize(
|
| + case _traceProviderRegistryMethodRegisterTraceProviderName:
|
| + var params = _TraceProviderRegistryRegisterTraceProviderParams.deserialize(
|
| message.payload);
|
| - _impl.createTrack(params.track);
|
| + _impl.registerTraceProvider(params.traceProvider);
|
| break;
|
| default:
|
| throw new bindings.MojoCodecError("Unexpected message name");
|
| @@ -249,15 +249,15 @@ class AudioServerStub extends bindings.Stub {
|
| return null;
|
| }
|
|
|
| - AudioServer get impl => _impl;
|
| - set impl(AudioServer d) {
|
| + TraceProviderRegistry get impl => _impl;
|
| + set impl(TraceProviderRegistry d) {
|
| assert(_impl == null);
|
| _impl = d;
|
| }
|
|
|
| String toString() {
|
| var superString = super.toString();
|
| - return "AudioServerStub($superString)";
|
| + return "TraceProviderRegistryStub($superString)";
|
| }
|
|
|
| int get version => 0;
|
| @@ -265,7 +265,7 @@ class AudioServerStub extends bindings.Stub {
|
| static service_describer.ServiceDescription _cachedServiceDescription;
|
| static service_describer.ServiceDescription get serviceDescription {
|
| if (_cachedServiceDescription == null) {
|
| - _cachedServiceDescription = new _AudioServerServiceDescription();
|
| + _cachedServiceDescription = new _TraceProviderRegistryServiceDescription();
|
| }
|
| return _cachedServiceDescription;
|
| }
|
|
|