Index: mojo/dart/packages/mojo_services/lib/mojo/media/media_clock.mojom.dart |
diff --git a/mojo/dart/packages/mojo_services/lib/mojo/media/media_clock.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/media/media_clock.mojom.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5f93d18d620b0610c43f3eecb4de492278aac7d9 |
--- /dev/null |
+++ b/mojo/dart/packages/mojo_services/lib/mojo/media/media_clock.mojom.dart |
@@ -0,0 +1,246 @@ |
+// Copyright 2014 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. |
+ |
+library media_clock_mojom; |
+ |
+import 'dart:async'; |
+ |
+import 'package:mojo/bindings.dart' as bindings; |
+import 'package:mojo/core.dart' as core; |
+class ClockDisposition extends bindings.MojoEnum { |
+ static const PASSIVE = const ClockDisposition._(0); |
+ static const SLAVE = const ClockDisposition._(1); |
+ static const PREFER_SLAVE = const ClockDisposition._(2); |
+ static const INDIFFERENT = const ClockDisposition._(3); |
+ static const PREFER_MASTER = const ClockDisposition._(4); |
+ static const MASTER = const ClockDisposition._(5); |
+ |
+ const ClockDisposition._(int v) : super(v); |
+ |
+ static const Map<String, ClockDisposition> valuesMap = const { |
+ "PASSIVE": PASSIVE, |
+ "SLAVE": SLAVE, |
+ "PREFER_SLAVE": PREFER_SLAVE, |
+ "INDIFFERENT": INDIFFERENT, |
+ "PREFER_MASTER": PREFER_MASTER, |
+ "MASTER": MASTER, |
+ }; |
+ static const List<ClockDisposition> values = const [ |
+ PASSIVE, |
+ SLAVE, |
+ PREFER_SLAVE, |
+ INDIFFERENT, |
+ PREFER_MASTER, |
+ MASTER, |
+ ]; |
+ |
+ static ClockDisposition valueOf(String name) => valuesMap[name]; |
+ |
+ factory ClockDisposition(int v) { |
+ switch (v) { |
+ case 0: |
+ return PASSIVE; |
+ case 1: |
+ return SLAVE; |
+ case 2: |
+ return PREFER_SLAVE; |
+ case 3: |
+ return INDIFFERENT; |
+ case 4: |
+ return PREFER_MASTER; |
+ case 5: |
+ return MASTER; |
+ default: |
+ return null; |
+ } |
+ } |
+ |
+ static ClockDisposition decode(bindings.Decoder decoder0, int offset) { |
+ int v = decoder0.decodeUint32(offset); |
+ ClockDisposition result = new ClockDisposition(v); |
+ if (result == null) { |
+ throw new bindings.MojoCodecError( |
+ 'Bad value $v for enum ClockDisposition.'); |
+ } |
+ return result; |
+ } |
+ |
+ String toString() { |
+ switch(this) { |
+ case PASSIVE: |
+ return 'ClockDisposition.PASSIVE'; |
+ case SLAVE: |
+ return 'ClockDisposition.SLAVE'; |
+ case PREFER_SLAVE: |
+ return 'ClockDisposition.PREFER_SLAVE'; |
+ case INDIFFERENT: |
+ return 'ClockDisposition.INDIFFERENT'; |
+ case PREFER_MASTER: |
+ return 'ClockDisposition.PREFER_MASTER'; |
+ case MASTER: |
+ return 'ClockDisposition.MASTER'; |
+ } |
+ } |
+ |
+ int toJson() => value; |
+} |
+ |
+ |
+const String ClockName = null; |
+ |
+abstract class Clock { |
+ |
+} |
+ |
+ |
+class ClockProxyImpl extends bindings.Proxy { |
+ ClockProxyImpl.fromEndpoint( |
+ core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
+ |
+ ClockProxyImpl.fromHandle(core.MojoHandle handle) : |
+ super.fromHandle(handle); |
+ |
+ ClockProxyImpl.unbound() : super.unbound(); |
+ |
+ static ClockProxyImpl newFromEndpoint( |
+ core.MojoMessagePipeEndpoint endpoint) { |
+ assert(endpoint.setDescription("For ClockProxyImpl")); |
+ return new ClockProxyImpl.fromEndpoint(endpoint); |
+ } |
+ |
+ String get name => ClockName; |
+ |
+ void handleResponse(bindings.ServiceMessage message) { |
+ switch (message.header.type) { |
+ default: |
+ proxyError("Unexpected message type: ${message.header.type}"); |
+ close(immediate: true); |
+ break; |
+ } |
+ } |
+ |
+ String toString() { |
+ var superString = super.toString(); |
+ return "ClockProxyImpl($superString)"; |
+ } |
+} |
+ |
+ |
+class _ClockProxyCalls implements Clock { |
+ ClockProxyImpl _proxyImpl; |
+ |
+ _ClockProxyCalls(this._proxyImpl); |
+} |
+ |
+ |
+class ClockProxy implements bindings.ProxyBase { |
+ final bindings.Proxy impl; |
+ Clock ptr; |
+ final String name = ClockName; |
+ |
+ ClockProxy(ClockProxyImpl proxyImpl) : |
+ impl = proxyImpl, |
+ ptr = new _ClockProxyCalls(proxyImpl); |
+ |
+ ClockProxy.fromEndpoint( |
+ core.MojoMessagePipeEndpoint endpoint) : |
+ impl = new ClockProxyImpl.fromEndpoint(endpoint) { |
+ ptr = new _ClockProxyCalls(impl); |
+ } |
+ |
+ ClockProxy.fromHandle(core.MojoHandle handle) : |
+ impl = new ClockProxyImpl.fromHandle(handle) { |
+ ptr = new _ClockProxyCalls(impl); |
+ } |
+ |
+ ClockProxy.unbound() : |
+ impl = new ClockProxyImpl.unbound() { |
+ ptr = new _ClockProxyCalls(impl); |
+ } |
+ |
+ factory ClockProxy.connectToService( |
+ bindings.ServiceConnector s, String url) { |
+ ClockProxy p = new ClockProxy.unbound(); |
+ s.connectToService(url, p); |
+ return p; |
+ } |
+ |
+ static ClockProxy newFromEndpoint( |
+ core.MojoMessagePipeEndpoint endpoint) { |
+ assert(endpoint.setDescription("For ClockProxy")); |
+ return new ClockProxy.fromEndpoint(endpoint); |
+ } |
+ |
+ Future close({bool immediate: false}) => impl.close(immediate: immediate); |
+ |
+ Future responseOrError(Future f) => impl.responseOrError(f); |
+ |
+ Future get errorFuture => impl.errorFuture; |
+ |
+ int get version => impl.version; |
+ |
+ Future<int> queryVersion() => impl.queryVersion(); |
+ |
+ void requireVersion(int requiredVersion) { |
+ impl.requireVersion(requiredVersion); |
+ } |
+ |
+ String toString() { |
+ return "ClockProxy($impl)"; |
+ } |
+} |
+ |
+ |
+class ClockStub extends bindings.Stub { |
+ Clock _impl = null; |
+ |
+ ClockStub.fromEndpoint( |
+ core.MojoMessagePipeEndpoint endpoint, [this._impl]) |
+ : super.fromEndpoint(endpoint); |
+ |
+ ClockStub.fromHandle(core.MojoHandle handle, [this._impl]) |
+ : super.fromHandle(handle); |
+ |
+ ClockStub.unbound() : super.unbound(); |
+ |
+ static ClockStub newFromEndpoint( |
+ core.MojoMessagePipeEndpoint endpoint) { |
+ assert(endpoint.setDescription("For ClockStub")); |
+ return new ClockStub.fromEndpoint(endpoint); |
+ } |
+ |
+ static const String name = ClockName; |
+ |
+ |
+ |
+ dynamic handleMessage(bindings.ServiceMessage message) { |
+ if (bindings.ControlMessageHandler.isControlMessage(message)) { |
+ return bindings.ControlMessageHandler.handleMessage(this, |
+ 0, |
+ message); |
+ } |
+ assert(_impl != null); |
+ switch (message.header.type) { |
+ default: |
+ throw new bindings.MojoCodecError("Unexpected message name"); |
+ break; |
+ } |
+ return null; |
+ } |
+ |
+ Clock get impl => _impl; |
+ set impl(Clock d) { |
+ assert(_impl == null); |
+ _impl = d; |
+ } |
+ |
+ String toString() { |
+ var superString = super.toString(); |
+ return "ClockStub($superString)"; |
+ } |
+ |
+ int get version => 0; |
+} |
+ |
+ |