OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 library vsync_mojom; | 5 library vsync_mojom; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:mojo/bindings.dart' as bindings; | 9 import 'package:mojo/bindings.dart' as bindings; |
10 import 'package:mojo/core.dart' as core; | 10 import 'package:mojo/core.dart' as core; |
| 11 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 12 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
11 | 13 |
12 | 14 |
13 | 15 |
14 class _VSyncProviderAwaitVSyncParams extends bindings.Struct { | 16 class _VSyncProviderAwaitVSyncParams extends bindings.Struct { |
15 static const List<bindings.StructDataHeader> kVersions = const [ | 17 static const List<bindings.StructDataHeader> kVersions = const [ |
16 const bindings.StructDataHeader(8, 0) | 18 const bindings.StructDataHeader(8, 0) |
17 ]; | 19 ]; |
18 | 20 |
19 _VSyncProviderAwaitVSyncParams() : super(kVersions.last.size); | 21 _VSyncProviderAwaitVSyncParams() : super(kVersions.last.size); |
20 | 22 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 return "_VSyncProviderAwaitVSyncParams("")"; | 64 return "_VSyncProviderAwaitVSyncParams("")"; |
63 } | 65 } |
64 | 66 |
65 Map toJson() { | 67 Map toJson() { |
66 Map map = new Map(); | 68 Map map = new Map(); |
67 return map; | 69 return map; |
68 } | 70 } |
69 } | 71 } |
70 | 72 |
71 | 73 |
| 74 |
| 75 |
72 class VSyncProviderAwaitVSyncResponseParams extends bindings.Struct { | 76 class VSyncProviderAwaitVSyncResponseParams extends bindings.Struct { |
73 static const List<bindings.StructDataHeader> kVersions = const [ | 77 static const List<bindings.StructDataHeader> kVersions = const [ |
74 const bindings.StructDataHeader(16, 0) | 78 const bindings.StructDataHeader(16, 0) |
75 ]; | 79 ]; |
76 int timeStamp = 0; | 80 int timeStamp = 0; |
77 | 81 |
78 VSyncProviderAwaitVSyncResponseParams() : super(kVersions.last.size); | 82 VSyncProviderAwaitVSyncResponseParams() : super(kVersions.last.size); |
79 | 83 |
80 static VSyncProviderAwaitVSyncResponseParams deserialize(bindings.Message mess
age) { | 84 static VSyncProviderAwaitVSyncResponseParams deserialize(bindings.Message mess
age) { |
81 var decoder = new bindings.Decoder(message); | 85 var decoder = new bindings.Decoder(message); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 "timeStamp: $timeStamp" ")"; | 132 "timeStamp: $timeStamp" ")"; |
129 } | 133 } |
130 | 134 |
131 Map toJson() { | 135 Map toJson() { |
132 Map map = new Map(); | 136 Map map = new Map(); |
133 map["timeStamp"] = timeStamp; | 137 map["timeStamp"] = timeStamp; |
134 return map; | 138 return map; |
135 } | 139 } |
136 } | 140 } |
137 | 141 |
| 142 |
| 143 |
| 144 |
138 const int _VSyncProvider_awaitVSyncName = 0; | 145 const int _VSyncProvider_awaitVSyncName = 0; |
139 | 146 |
| 147 |
| 148 |
| 149 class _VSyncProviderServiceDescription implements service_describer.ServiceDescr
iption { |
| 150 dynamic getTopLevelInterface([Function responseFactory = null]) => null; |
| 151 |
| 152 dynamic getTypeDefinition(String typeKey, [Function responseFactory = null]) =
> |
| 153 null; |
| 154 |
| 155 dynamic getAllTypeDefinitions([Function responseFactory = null]) => null; |
| 156 } |
| 157 |
140 abstract class VSyncProvider { | 158 abstract class VSyncProvider { |
141 static const String serviceName = "vsync::VSyncProvider"; | 159 static const String serviceName = "vsync::VSyncProvider"; |
142 dynamic awaitVSync([Function responseFactory = null]); | 160 dynamic awaitVSync([Function responseFactory = null]); |
143 } | 161 } |
144 | 162 |
145 | 163 |
146 class _VSyncProviderProxyImpl extends bindings.Proxy { | 164 class _VSyncProviderProxyImpl extends bindings.Proxy { |
147 _VSyncProviderProxyImpl.fromEndpoint( | 165 _VSyncProviderProxyImpl.fromEndpoint( |
148 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 166 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
149 | 167 |
150 _VSyncProviderProxyImpl.fromHandle(core.MojoHandle handle) : | 168 _VSyncProviderProxyImpl.fromHandle(core.MojoHandle handle) : |
151 super.fromHandle(handle); | 169 super.fromHandle(handle); |
152 | 170 |
153 _VSyncProviderProxyImpl.unbound() : super.unbound(); | 171 _VSyncProviderProxyImpl.unbound() : super.unbound(); |
154 | 172 |
155 static _VSyncProviderProxyImpl newFromEndpoint( | 173 static _VSyncProviderProxyImpl newFromEndpoint( |
156 core.MojoMessagePipeEndpoint endpoint) { | 174 core.MojoMessagePipeEndpoint endpoint) { |
157 assert(endpoint.setDescription("For _VSyncProviderProxyImpl")); | 175 assert(endpoint.setDescription("For _VSyncProviderProxyImpl")); |
158 return new _VSyncProviderProxyImpl.fromEndpoint(endpoint); | 176 return new _VSyncProviderProxyImpl.fromEndpoint(endpoint); |
159 } | 177 } |
160 | 178 |
| 179 service_describer.ServiceDescription get serviceDescription => |
| 180 new _VSyncProviderServiceDescription(); |
| 181 |
161 void handleResponse(bindings.ServiceMessage message) { | 182 void handleResponse(bindings.ServiceMessage message) { |
162 switch (message.header.type) { | 183 switch (message.header.type) { |
163 case _VSyncProvider_awaitVSyncName: | 184 case _VSyncProvider_awaitVSyncName: |
164 var r = VSyncProviderAwaitVSyncResponseParams.deserialize( | 185 var r = VSyncProviderAwaitVSyncResponseParams.deserialize( |
165 message.payload); | 186 message.payload); |
166 if (!message.header.hasRequestId) { | 187 if (!message.header.hasRequestId) { |
167 proxyError("Expected a message with a valid request Id."); | 188 proxyError("Expected a message with a valid request Id."); |
168 return; | 189 return; |
169 } | 190 } |
170 Completer c = completerMap[message.header.requestId]; | 191 Completer c = completerMap[message.header.requestId]; |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 assert(_impl == null); | 356 assert(_impl == null); |
336 _impl = d; | 357 _impl = d; |
337 } | 358 } |
338 | 359 |
339 String toString() { | 360 String toString() { |
340 var superString = super.toString(); | 361 var superString = super.toString(); |
341 return "VSyncProviderStub($superString)"; | 362 return "VSyncProviderStub($superString)"; |
342 } | 363 } |
343 | 364 |
344 int get version => 0; | 365 int get version => 0; |
| 366 |
| 367 service_describer.ServiceDescription get serviceDescription => |
| 368 new _VSyncProviderServiceDescription(); |
345 } | 369 } |
346 | 370 |
347 | 371 |
| 372 |
| 373 |
OLD | NEW |