Index: mojo/dart/packages/mojo_services/lib/mojo/media/media_player.mojom.dart |
diff --git a/mojo/dart/packages/mojo_services/lib/mojo/cookie_store.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/media/media_player.mojom.dart |
similarity index 50% |
copy from mojo/dart/packages/mojo_services/lib/mojo/cookie_store.mojom.dart |
copy to mojo/dart/packages/mojo_services/lib/mojo/media/media_player.mojom.dart |
index b207a51c165641ebf3e116a08898a8eb0fbfa0bb..bc5a72d9344e9935d06879e2bc7c30de5882e859 100644 |
--- a/mojo/dart/packages/mojo_services/lib/mojo/cookie_store.mojom.dart |
+++ b/mojo/dart/packages/mojo_services/lib/mojo/media/media_player.mojom.dart |
@@ -2,24 +2,29 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-library cookie_store_mojom; |
+library media_player_mojom; |
import 'dart:async'; |
import 'package:mojo/bindings.dart' as bindings; |
import 'package:mojo/core.dart' as core; |
+import 'package:mojo_services/mojo/media/media_metadata.mojom.dart' as media_metadata_mojom; |
+import 'package:mojo_services/mojo/media/media_state.mojom.dart' as media_state_mojom; |
+import 'package:mojo_services/mojo/media/rate_control.mojom.dart' as rate_control_mojom; |
-class _CookieStoreGetParams extends bindings.Struct { |
+class MediaPlayerStatus extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
- const bindings.StructDataHeader(16, 0) |
+ const bindings.StructDataHeader(32, 0) |
]; |
- String url = null; |
+ media_state_mojom.MediaState state = null; |
+ rate_control_mojom.TimelineTransform timelineTransform = null; |
+ media_metadata_mojom.MediaMetadata metadata = null; |
- _CookieStoreGetParams() : super(kVersions.last.size); |
+ MediaPlayerStatus() : super(kVersions.last.size); |
- static _CookieStoreGetParams deserialize(bindings.Message message) { |
+ static MediaPlayerStatus deserialize(bindings.Message message) { |
var decoder = new bindings.Decoder(message); |
var result = decode(decoder); |
if (decoder.excessHandles != null) { |
@@ -28,11 +33,11 @@ class _CookieStoreGetParams extends bindings.Struct { |
return result; |
} |
- static _CookieStoreGetParams decode(bindings.Decoder decoder0) { |
+ static MediaPlayerStatus decode(bindings.Decoder decoder0) { |
if (decoder0 == null) { |
return null; |
} |
- _CookieStoreGetParams result = new _CookieStoreGetParams(); |
+ MediaPlayerStatus result = new MediaPlayerStatus(); |
var mainDataHeader = decoder0.decodeStructDataHeader(); |
if (mainDataHeader.version <= kVersions.last.version) { |
@@ -54,7 +59,21 @@ class _CookieStoreGetParams extends bindings.Struct { |
} |
if (mainDataHeader.version >= 0) { |
- result.url = decoder0.decodeString(8, false); |
+ result.state = media_state_mojom.MediaState.decode(decoder0, 8); |
+ if (result.state == null) { |
+ throw new bindings.MojoCodecError( |
+ 'Trying to decode null union for non-nullable media_state_mojom.MediaState.'); |
+ } |
+ } |
+ if (mainDataHeader.version >= 0) { |
+ |
+ var decoder1 = decoder0.decodePointer(16, true); |
+ result.timelineTransform = rate_control_mojom.TimelineTransform.decode(decoder1); |
+ } |
+ if (mainDataHeader.version >= 0) { |
+ |
+ var decoder1 = decoder0.decodePointer(24, true); |
+ result.metadata = media_metadata_mojom.MediaMetadata.decode(decoder1); |
} |
return result; |
} |
@@ -62,31 +81,38 @@ class _CookieStoreGetParams extends bindings.Struct { |
void encode(bindings.Encoder encoder) { |
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
- encoder0.encodeString(url, 8, false); |
+ encoder0.encodeEnum(state, 8); |
+ |
+ encoder0.encodeStruct(timelineTransform, 16, true); |
+ |
+ encoder0.encodeStruct(metadata, 24, true); |
} |
String toString() { |
- return "_CookieStoreGetParams(" |
- "url: $url" ")"; |
+ return "MediaPlayerStatus(" |
+ "state: $state" ", " |
+ "timelineTransform: $timelineTransform" ", " |
+ "metadata: $metadata" ")"; |
} |
Map toJson() { |
Map map = new Map(); |
- map["url"] = url; |
+ map["state"] = state; |
+ map["timelineTransform"] = timelineTransform; |
+ map["metadata"] = metadata; |
return map; |
} |
} |
-class CookieStoreGetResponseParams extends bindings.Struct { |
+class _MediaPlayerPlayParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
- const bindings.StructDataHeader(16, 0) |
+ const bindings.StructDataHeader(8, 0) |
]; |
- String cookies = null; |
- CookieStoreGetResponseParams() : super(kVersions.last.size); |
+ _MediaPlayerPlayParams() : super(kVersions.last.size); |
- static CookieStoreGetResponseParams deserialize(bindings.Message message) { |
+ static _MediaPlayerPlayParams deserialize(bindings.Message message) { |
var decoder = new bindings.Decoder(message); |
var result = decode(decoder); |
if (decoder.excessHandles != null) { |
@@ -95,11 +121,11 @@ class CookieStoreGetResponseParams extends bindings.Struct { |
return result; |
} |
- static CookieStoreGetResponseParams decode(bindings.Decoder decoder0) { |
+ static _MediaPlayerPlayParams decode(bindings.Decoder decoder0) { |
if (decoder0 == null) { |
return null; |
} |
- CookieStoreGetResponseParams result = new CookieStoreGetResponseParams(); |
+ _MediaPlayerPlayParams result = new _MediaPlayerPlayParams(); |
var mainDataHeader = decoder0.decodeStructDataHeader(); |
if (mainDataHeader.version <= kVersions.last.version) { |
@@ -119,42 +145,32 @@ class CookieStoreGetResponseParams extends bindings.Struct { |
'Message newer than the last known version cannot be shorter than ' |
'required by the last known version.'); |
} |
- if (mainDataHeader.version >= 0) { |
- |
- result.cookies = decoder0.decodeString(8, false); |
- } |
return result; |
} |
void encode(bindings.Encoder encoder) { |
- var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
- |
- encoder0.encodeString(cookies, 8, false); |
+ encoder.getStructEncoderAtOffset(kVersions.last); |
} |
String toString() { |
- return "CookieStoreGetResponseParams(" |
- "cookies: $cookies" ")"; |
+ return "_MediaPlayerPlayParams("")"; |
} |
Map toJson() { |
Map map = new Map(); |
- map["cookies"] = cookies; |
return map; |
} |
} |
-class _CookieStoreSetParams extends bindings.Struct { |
+class _MediaPlayerPauseParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
- const bindings.StructDataHeader(24, 0) |
+ const bindings.StructDataHeader(8, 0) |
]; |
- String url = null; |
- String cookie = null; |
- _CookieStoreSetParams() : super(kVersions.last.size); |
+ _MediaPlayerPauseParams() : super(kVersions.last.size); |
- static _CookieStoreSetParams deserialize(bindings.Message message) { |
+ static _MediaPlayerPauseParams deserialize(bindings.Message message) { |
var decoder = new bindings.Decoder(message); |
var result = decode(decoder); |
if (decoder.excessHandles != null) { |
@@ -163,11 +179,11 @@ class _CookieStoreSetParams extends bindings.Struct { |
return result; |
} |
- static _CookieStoreSetParams decode(bindings.Decoder decoder0) { |
+ static _MediaPlayerPauseParams decode(bindings.Decoder decoder0) { |
if (decoder0 == null) { |
return null; |
} |
- _CookieStoreSetParams result = new _CookieStoreSetParams(); |
+ _MediaPlayerPauseParams result = new _MediaPlayerPauseParams(); |
var mainDataHeader = decoder0.decodeStructDataHeader(); |
if (mainDataHeader.version <= kVersions.last.version) { |
@@ -187,13 +203,68 @@ class _CookieStoreSetParams extends bindings.Struct { |
'Message newer than the last known version cannot be shorter than ' |
'required by the last known version.'); |
} |
- if (mainDataHeader.version >= 0) { |
- |
- result.url = decoder0.decodeString(8, false); |
+ return result; |
+ } |
+ |
+ void encode(bindings.Encoder encoder) { |
+ encoder.getStructEncoderAtOffset(kVersions.last); |
+ } |
+ |
+ String toString() { |
+ return "_MediaPlayerPauseParams("")"; |
+ } |
+ |
+ Map toJson() { |
+ Map map = new Map(); |
+ return map; |
+ } |
+} |
+ |
+ |
+class _MediaPlayerGetStatusParams extends bindings.Struct { |
+ static const List<bindings.StructDataHeader> kVersions = const [ |
+ const bindings.StructDataHeader(16, 0) |
+ ]; |
+ int versionLastSeen = 0; |
+ |
+ _MediaPlayerGetStatusParams() : super(kVersions.last.size); |
+ |
+ static _MediaPlayerGetStatusParams deserialize(bindings.Message message) { |
+ var decoder = new bindings.Decoder(message); |
+ var result = decode(decoder); |
+ if (decoder.excessHandles != null) { |
+ decoder.excessHandles.forEach((h) => h.close()); |
+ } |
+ return result; |
+ } |
+ |
+ static _MediaPlayerGetStatusParams decode(bindings.Decoder decoder0) { |
+ if (decoder0 == null) { |
+ return null; |
+ } |
+ _MediaPlayerGetStatusParams result = new _MediaPlayerGetStatusParams(); |
+ |
+ var mainDataHeader = decoder0.decodeStructDataHeader(); |
+ if (mainDataHeader.version <= kVersions.last.version) { |
+ // Scan in reverse order to optimize for more recent versions. |
+ for (int i = kVersions.length - 1; i >= 0; --i) { |
+ if (mainDataHeader.version >= kVersions[i].version) { |
+ if (mainDataHeader.size == kVersions[i].size) { |
+ // Found a match. |
+ break; |
+ } |
+ throw new bindings.MojoCodecError( |
+ 'Header size doesn\'t correspond to known version size.'); |
+ } |
+ } |
+ } else if (mainDataHeader.size < kVersions.last.size) { |
+ throw new bindings.MojoCodecError( |
+ 'Message newer than the last known version cannot be shorter than ' |
+ 'required by the last known version.'); |
} |
if (mainDataHeader.version >= 0) { |
- result.cookie = decoder0.decodeString(16, false); |
+ result.versionLastSeen = decoder0.decodeUint64(8); |
} |
return result; |
} |
@@ -201,35 +272,32 @@ class _CookieStoreSetParams extends bindings.Struct { |
void encode(bindings.Encoder encoder) { |
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
- encoder0.encodeString(url, 8, false); |
- |
- encoder0.encodeString(cookie, 16, false); |
+ encoder0.encodeUint64(versionLastSeen, 8); |
} |
String toString() { |
- return "_CookieStoreSetParams(" |
- "url: $url" ", " |
- "cookie: $cookie" ")"; |
+ return "_MediaPlayerGetStatusParams(" |
+ "versionLastSeen: $versionLastSeen" ")"; |
} |
Map toJson() { |
Map map = new Map(); |
- map["url"] = url; |
- map["cookie"] = cookie; |
+ map["versionLastSeen"] = versionLastSeen; |
return map; |
} |
} |
-class CookieStoreSetResponseParams extends bindings.Struct { |
+class MediaPlayerGetStatusResponseParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
- const bindings.StructDataHeader(16, 0) |
+ const bindings.StructDataHeader(24, 0) |
]; |
- bool success = false; |
+ int version = 0; |
+ MediaPlayerStatus status = null; |
- CookieStoreSetResponseParams() : super(kVersions.last.size); |
+ MediaPlayerGetStatusResponseParams() : super(kVersions.last.size); |
- static CookieStoreSetResponseParams deserialize(bindings.Message message) { |
+ static MediaPlayerGetStatusResponseParams deserialize(bindings.Message message) { |
var decoder = new bindings.Decoder(message); |
var result = decode(decoder); |
if (decoder.excessHandles != null) { |
@@ -238,11 +306,11 @@ class CookieStoreSetResponseParams extends bindings.Struct { |
return result; |
} |
- static CookieStoreSetResponseParams decode(bindings.Decoder decoder0) { |
+ static MediaPlayerGetStatusResponseParams decode(bindings.Decoder decoder0) { |
if (decoder0 == null) { |
return null; |
} |
- CookieStoreSetResponseParams result = new CookieStoreSetResponseParams(); |
+ MediaPlayerGetStatusResponseParams result = new MediaPlayerGetStatusResponseParams(); |
var mainDataHeader = decoder0.decodeStructDataHeader(); |
if (mainDataHeader.version <= kVersions.last.version) { |
@@ -264,7 +332,12 @@ class CookieStoreSetResponseParams extends bindings.Struct { |
} |
if (mainDataHeader.version >= 0) { |
- result.success = decoder0.decodeBool(8, 0); |
+ result.version = decoder0.decodeUint64(8); |
+ } |
+ if (mainDataHeader.version >= 0) { |
+ |
+ var decoder1 = decoder0.decodePointer(16, false); |
+ result.status = MediaPlayerStatus.decode(decoder1); |
} |
return result; |
} |
@@ -272,70 +345,56 @@ class CookieStoreSetResponseParams extends bindings.Struct { |
void encode(bindings.Encoder encoder) { |
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
- encoder0.encodeBool(success, 8, 0); |
+ encoder0.encodeUint64(version, 8); |
+ |
+ encoder0.encodeStruct(status, 16, false); |
} |
String toString() { |
- return "CookieStoreSetResponseParams(" |
- "success: $success" ")"; |
+ return "MediaPlayerGetStatusResponseParams(" |
+ "version: $version" ", " |
+ "status: $status" ")"; |
} |
Map toJson() { |
Map map = new Map(); |
- map["success"] = success; |
+ map["version"] = version; |
+ map["status"] = status; |
return map; |
} |
} |
-const int _CookieStore_getName = 0; |
-const int _CookieStore_setName = 1; |
+const int _MediaPlayer_playName = 0; |
+const int _MediaPlayer_pauseName = 1; |
+const int _MediaPlayer_getStatusName = 2; |
-abstract class CookieStore { |
+abstract class MediaPlayer { |
static const String serviceName = null; |
- dynamic get(String url,[Function responseFactory = null]); |
- dynamic set(String url,String cookie,[Function responseFactory = null]); |
+ void play(); |
+ void pause(); |
+ dynamic getStatus(int versionLastSeen,[Function responseFactory = null]); |
} |
-class _CookieStoreProxyImpl extends bindings.Proxy { |
- _CookieStoreProxyImpl.fromEndpoint( |
+class _MediaPlayerProxyImpl extends bindings.Proxy { |
+ _MediaPlayerProxyImpl.fromEndpoint( |
core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
- _CookieStoreProxyImpl.fromHandle(core.MojoHandle handle) : |
+ _MediaPlayerProxyImpl.fromHandle(core.MojoHandle handle) : |
super.fromHandle(handle); |
- _CookieStoreProxyImpl.unbound() : super.unbound(); |
+ _MediaPlayerProxyImpl.unbound() : super.unbound(); |
- static _CookieStoreProxyImpl newFromEndpoint( |
+ static _MediaPlayerProxyImpl newFromEndpoint( |
core.MojoMessagePipeEndpoint endpoint) { |
- assert(endpoint.setDescription("For _CookieStoreProxyImpl")); |
- return new _CookieStoreProxyImpl.fromEndpoint(endpoint); |
+ assert(endpoint.setDescription("For _MediaPlayerProxyImpl")); |
+ return new _MediaPlayerProxyImpl.fromEndpoint(endpoint); |
} |
void handleResponse(bindings.ServiceMessage message) { |
switch (message.header.type) { |
- case _CookieStore_getName: |
- var r = CookieStoreGetResponseParams.deserialize( |
- message.payload); |
- if (!message.header.hasRequestId) { |
- proxyError("Expected a message with a valid request Id."); |
- return; |
- } |
- Completer c = completerMap[message.header.requestId]; |
- if (c == null) { |
- proxyError( |
- "Message had unknown request Id: ${message.header.requestId}"); |
- return; |
- } |
- completerMap.remove(message.header.requestId); |
- if (c.isCompleted) { |
- proxyError("Response completer already completed"); |
- return; |
- } |
- c.complete(r); |
- break; |
- case _CookieStore_setName: |
- var r = CookieStoreSetResponseParams.deserialize( |
+ case _MediaPlayer_getStatusName: |
+ var r = MediaPlayerGetStatusResponseParams.deserialize( |
message.payload); |
if (!message.header.hasRequestId) { |
proxyError("Expected a message with a valid request Id."); |
@@ -363,75 +422,81 @@ class _CookieStoreProxyImpl extends bindings.Proxy { |
String toString() { |
var superString = super.toString(); |
- return "_CookieStoreProxyImpl($superString)"; |
+ return "_MediaPlayerProxyImpl($superString)"; |
} |
} |
-class _CookieStoreProxyCalls implements CookieStore { |
- _CookieStoreProxyImpl _proxyImpl; |
+class _MediaPlayerProxyCalls implements MediaPlayer { |
+ _MediaPlayerProxyImpl _proxyImpl; |
- _CookieStoreProxyCalls(this._proxyImpl); |
- dynamic get(String url,[Function responseFactory = null]) { |
- var params = new _CookieStoreGetParams(); |
- params.url = url; |
- return _proxyImpl.sendMessageWithRequestId( |
- params, |
- _CookieStore_getName, |
- -1, |
- bindings.MessageHeader.kMessageExpectsResponse); |
+ _MediaPlayerProxyCalls(this._proxyImpl); |
+ void play() { |
+ if (!_proxyImpl.isBound) { |
+ _proxyImpl.proxyError("The Proxy is closed."); |
+ return; |
+ } |
+ var params = new _MediaPlayerPlayParams(); |
+ _proxyImpl.sendMessage(params, _MediaPlayer_playName); |
+ } |
+ void pause() { |
+ if (!_proxyImpl.isBound) { |
+ _proxyImpl.proxyError("The Proxy is closed."); |
+ return; |
+ } |
+ var params = new _MediaPlayerPauseParams(); |
+ _proxyImpl.sendMessage(params, _MediaPlayer_pauseName); |
} |
- dynamic set(String url,String cookie,[Function responseFactory = null]) { |
- var params = new _CookieStoreSetParams(); |
- params.url = url; |
- params.cookie = cookie; |
+ dynamic getStatus(int versionLastSeen,[Function responseFactory = null]) { |
+ var params = new _MediaPlayerGetStatusParams(); |
+ params.versionLastSeen = versionLastSeen; |
return _proxyImpl.sendMessageWithRequestId( |
params, |
- _CookieStore_setName, |
+ _MediaPlayer_getStatusName, |
-1, |
bindings.MessageHeader.kMessageExpectsResponse); |
} |
} |
-class CookieStoreProxy implements bindings.ProxyBase { |
+class MediaPlayerProxy implements bindings.ProxyBase { |
final bindings.Proxy impl; |
- CookieStore ptr; |
+ MediaPlayer ptr; |
- CookieStoreProxy(_CookieStoreProxyImpl proxyImpl) : |
+ MediaPlayerProxy(_MediaPlayerProxyImpl proxyImpl) : |
impl = proxyImpl, |
- ptr = new _CookieStoreProxyCalls(proxyImpl); |
+ ptr = new _MediaPlayerProxyCalls(proxyImpl); |
- CookieStoreProxy.fromEndpoint( |
+ MediaPlayerProxy.fromEndpoint( |
core.MojoMessagePipeEndpoint endpoint) : |
- impl = new _CookieStoreProxyImpl.fromEndpoint(endpoint) { |
- ptr = new _CookieStoreProxyCalls(impl); |
+ impl = new _MediaPlayerProxyImpl.fromEndpoint(endpoint) { |
+ ptr = new _MediaPlayerProxyCalls(impl); |
} |
- CookieStoreProxy.fromHandle(core.MojoHandle handle) : |
- impl = new _CookieStoreProxyImpl.fromHandle(handle) { |
- ptr = new _CookieStoreProxyCalls(impl); |
+ MediaPlayerProxy.fromHandle(core.MojoHandle handle) : |
+ impl = new _MediaPlayerProxyImpl.fromHandle(handle) { |
+ ptr = new _MediaPlayerProxyCalls(impl); |
} |
- CookieStoreProxy.unbound() : |
- impl = new _CookieStoreProxyImpl.unbound() { |
- ptr = new _CookieStoreProxyCalls(impl); |
+ MediaPlayerProxy.unbound() : |
+ impl = new _MediaPlayerProxyImpl.unbound() { |
+ ptr = new _MediaPlayerProxyCalls(impl); |
} |
- factory CookieStoreProxy.connectToService( |
+ factory MediaPlayerProxy.connectToService( |
bindings.ServiceConnector s, String url, [String serviceName]) { |
- CookieStoreProxy p = new CookieStoreProxy.unbound(); |
+ MediaPlayerProxy p = new MediaPlayerProxy.unbound(); |
s.connectToService(url, p, serviceName); |
return p; |
} |
- static CookieStoreProxy newFromEndpoint( |
+ static MediaPlayerProxy newFromEndpoint( |
core.MojoMessagePipeEndpoint endpoint) { |
- assert(endpoint.setDescription("For CookieStoreProxy")); |
- return new CookieStoreProxy.fromEndpoint(endpoint); |
+ assert(endpoint.setDescription("For MediaPlayerProxy")); |
+ return new MediaPlayerProxy.fromEndpoint(endpoint); |
} |
- String get serviceName => CookieStore.serviceName; |
+ String get serviceName => MediaPlayer.serviceName; |
Future close({bool immediate: false}) => impl.close(immediate: immediate); |
@@ -448,38 +513,34 @@ class CookieStoreProxy implements bindings.ProxyBase { |
} |
String toString() { |
- return "CookieStoreProxy($impl)"; |
+ return "MediaPlayerProxy($impl)"; |
} |
} |
-class CookieStoreStub extends bindings.Stub { |
- CookieStore _impl = null; |
+class MediaPlayerStub extends bindings.Stub { |
+ MediaPlayer _impl = null; |
- CookieStoreStub.fromEndpoint( |
+ MediaPlayerStub.fromEndpoint( |
core.MojoMessagePipeEndpoint endpoint, [this._impl]) |
: super.fromEndpoint(endpoint); |
- CookieStoreStub.fromHandle(core.MojoHandle handle, [this._impl]) |
+ MediaPlayerStub.fromHandle(core.MojoHandle handle, [this._impl]) |
: super.fromHandle(handle); |
- CookieStoreStub.unbound() : super.unbound(); |
+ MediaPlayerStub.unbound() : super.unbound(); |
- static CookieStoreStub newFromEndpoint( |
+ static MediaPlayerStub newFromEndpoint( |
core.MojoMessagePipeEndpoint endpoint) { |
- assert(endpoint.setDescription("For CookieStoreStub")); |
- return new CookieStoreStub.fromEndpoint(endpoint); |
+ assert(endpoint.setDescription("For MediaPlayerStub")); |
+ return new MediaPlayerStub.fromEndpoint(endpoint); |
} |
- CookieStoreGetResponseParams _CookieStoreGetResponseParamsFactory(String cookies) { |
- var mojo_factory_result = new CookieStoreGetResponseParams(); |
- mojo_factory_result.cookies = cookies; |
- return mojo_factory_result; |
- } |
- CookieStoreSetResponseParams _CookieStoreSetResponseParamsFactory(bool success) { |
- var mojo_factory_result = new CookieStoreSetResponseParams(); |
- mojo_factory_result.success = success; |
+ MediaPlayerGetStatusResponseParams _MediaPlayerGetStatusResponseParamsFactory(int version, MediaPlayerStatus status) { |
+ var mojo_factory_result = new MediaPlayerGetStatusResponseParams(); |
+ mojo_factory_result.version = version; |
+ mojo_factory_result.status = status; |
return mojo_factory_result; |
} |
@@ -491,38 +552,26 @@ class CookieStoreStub extends bindings.Stub { |
} |
assert(_impl != null); |
switch (message.header.type) { |
- case _CookieStore_getName: |
- var params = _CookieStoreGetParams.deserialize( |
+ case _MediaPlayer_playName: |
+ var params = _MediaPlayerPlayParams.deserialize( |
message.payload); |
- var response = _impl.get(params.url,_CookieStoreGetResponseParamsFactory); |
- if (response is Future) { |
- return response.then((response) { |
- if (response != null) { |
- return buildResponseWithId( |
- response, |
- _CookieStore_getName, |
- message.header.requestId, |
- bindings.MessageHeader.kMessageIsResponse); |
- } |
- }); |
- } else if (response != null) { |
- return buildResponseWithId( |
- response, |
- _CookieStore_getName, |
- message.header.requestId, |
- bindings.MessageHeader.kMessageIsResponse); |
- } |
+ _impl.play(); |
+ break; |
+ case _MediaPlayer_pauseName: |
+ var params = _MediaPlayerPauseParams.deserialize( |
+ message.payload); |
+ _impl.pause(); |
break; |
- case _CookieStore_setName: |
- var params = _CookieStoreSetParams.deserialize( |
+ case _MediaPlayer_getStatusName: |
+ var params = _MediaPlayerGetStatusParams.deserialize( |
message.payload); |
- var response = _impl.set(params.url,params.cookie,_CookieStoreSetResponseParamsFactory); |
+ var response = _impl.getStatus(params.versionLastSeen,_MediaPlayerGetStatusResponseParamsFactory); |
if (response is Future) { |
return response.then((response) { |
if (response != null) { |
return buildResponseWithId( |
response, |
- _CookieStore_setName, |
+ _MediaPlayer_getStatusName, |
message.header.requestId, |
bindings.MessageHeader.kMessageIsResponse); |
} |
@@ -530,7 +579,7 @@ class CookieStoreStub extends bindings.Stub { |
} else if (response != null) { |
return buildResponseWithId( |
response, |
- _CookieStore_setName, |
+ _MediaPlayer_getStatusName, |
message.header.requestId, |
bindings.MessageHeader.kMessageIsResponse); |
} |
@@ -542,15 +591,15 @@ class CookieStoreStub extends bindings.Stub { |
return null; |
} |
- CookieStore get impl => _impl; |
- set impl(CookieStore d) { |
+ MediaPlayer get impl => _impl; |
+ set impl(MediaPlayer d) { |
assert(_impl == null); |
_impl = d; |
} |
String toString() { |
var superString = super.toString(); |
- return "CookieStoreStub($superString)"; |
+ return "MediaPlayerStub($superString)"; |
} |
int get version => 0; |