| 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; |
| 151 |
| 152 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 153 |
| 154 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 155 } |
| 156 |
| 140 abstract class VSyncProvider { | 157 abstract class VSyncProvider { |
| 141 static const String serviceName = "vsync::VSyncProvider"; | 158 static const String serviceName = "vsync::VSyncProvider"; |
| 142 dynamic awaitVSync([Function responseFactory = null]); | 159 dynamic awaitVSync([Function responseFactory = null]); |
| 143 } | 160 } |
| 144 | 161 |
| 145 | 162 |
| 146 class _VSyncProviderProxyImpl extends bindings.Proxy { | 163 class _VSyncProviderProxyImpl extends bindings.Proxy { |
| 147 _VSyncProviderProxyImpl.fromEndpoint( | 164 _VSyncProviderProxyImpl.fromEndpoint( |
| 148 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 165 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 149 | 166 |
| 150 _VSyncProviderProxyImpl.fromHandle(core.MojoHandle handle) : | 167 _VSyncProviderProxyImpl.fromHandle(core.MojoHandle handle) : |
| 151 super.fromHandle(handle); | 168 super.fromHandle(handle); |
| 152 | 169 |
| 153 _VSyncProviderProxyImpl.unbound() : super.unbound(); | 170 _VSyncProviderProxyImpl.unbound() : super.unbound(); |
| 154 | 171 |
| 155 static _VSyncProviderProxyImpl newFromEndpoint( | 172 static _VSyncProviderProxyImpl newFromEndpoint( |
| 156 core.MojoMessagePipeEndpoint endpoint) { | 173 core.MojoMessagePipeEndpoint endpoint) { |
| 157 assert(endpoint.setDescription("For _VSyncProviderProxyImpl")); | 174 assert(endpoint.setDescription("For _VSyncProviderProxyImpl")); |
| 158 return new _VSyncProviderProxyImpl.fromEndpoint(endpoint); | 175 return new _VSyncProviderProxyImpl.fromEndpoint(endpoint); |
| 159 } | 176 } |
| 160 | 177 |
| 178 service_describer.ServiceDescription get serviceDescription => |
| 179 new _VSyncProviderServiceDescription(); |
| 180 |
| 161 void handleResponse(bindings.ServiceMessage message) { | 181 void handleResponse(bindings.ServiceMessage message) { |
| 162 switch (message.header.type) { | 182 switch (message.header.type) { |
| 163 case _VSyncProvider_awaitVSyncName: | 183 case _VSyncProvider_awaitVSyncName: |
| 164 var r = VSyncProviderAwaitVSyncResponseParams.deserialize( | 184 var r = VSyncProviderAwaitVSyncResponseParams.deserialize( |
| 165 message.payload); | 185 message.payload); |
| 166 if (!message.header.hasRequestId) { | 186 if (!message.header.hasRequestId) { |
| 167 proxyError("Expected a message with a valid request Id."); | 187 proxyError("Expected a message with a valid request Id."); |
| 168 return; | 188 return; |
| 169 } | 189 } |
| 170 Completer c = completerMap[message.header.requestId]; | 190 Completer c = completerMap[message.header.requestId]; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 assert(_impl == null); | 355 assert(_impl == null); |
| 336 _impl = d; | 356 _impl = d; |
| 337 } | 357 } |
| 338 | 358 |
| 339 String toString() { | 359 String toString() { |
| 340 var superString = super.toString(); | 360 var superString = super.toString(); |
| 341 return "VSyncProviderStub($superString)"; | 361 return "VSyncProviderStub($superString)"; |
| 342 } | 362 } |
| 343 | 363 |
| 344 int get version => 0; | 364 int get version => 0; |
| 365 |
| 366 service_describer.ServiceDescription get serviceDescription => |
| 367 new _VSyncProviderServiceDescription(); |
| 345 } | 368 } |
| 346 | 369 |
| 347 | 370 |
| 371 |
| OLD | NEW |