| 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 sample_interfaces_mojom; | 5 library activity_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 const kLong = 4405; | 11 class SystemUiVisibility extends bindings.MojoEnum { |
| 12 class Enum extends bindings.MojoEnum { | 12 static const STANDARD = const SystemUiVisibility._(0); |
| 13 static const VALUE = const Enum._(0); | 13 static const FULLSCREEN = const SystemUiVisibility._(1); |
| 14 | 14 static const IMMERSIVE = const SystemUiVisibility._(2); |
| 15 const Enum._(int v) : super(v); | 15 |
| 16 | 16 const SystemUiVisibility._(int v) : super(v); |
| 17 static const Map<String, Enum> valuesMap = const { | 17 |
| 18 "VALUE": VALUE, | 18 static const Map<String, SystemUiVisibility> valuesMap = const { |
| 19 }; | 19 "STANDARD": STANDARD, |
| 20 static const List<Enum> values = const [ | 20 "FULLSCREEN": FULLSCREEN, |
| 21 VALUE, | 21 "IMMERSIVE": IMMERSIVE, |
| 22 ]; | 22 }; |
| 23 | 23 static const List<SystemUiVisibility> values = const [ |
| 24 static Enum valueOf(String name) => valuesMap[name]; | 24 STANDARD, |
| 25 | 25 FULLSCREEN, |
| 26 factory Enum(int v) { | 26 IMMERSIVE, |
| 27 switch (v) { | 27 ]; |
| 28 case 0: | 28 |
| 29 return VALUE; | 29 static SystemUiVisibility valueOf(String name) => valuesMap[name]; |
| 30 default: | 30 |
| 31 return null; | 31 factory SystemUiVisibility(int v) { |
| 32 } | 32 switch (v) { |
| 33 } | 33 case 0: |
| 34 | 34 return STANDARD; |
| 35 static Enum decode(bindings.Decoder decoder0, int offset) { | 35 case 1: |
| 36 int v = decoder0.decodeUint32(offset); | 36 return FULLSCREEN; |
| 37 Enum result = new Enum(v); | 37 case 2: |
| 38 if (result == null) { | 38 return IMMERSIVE; |
| 39 throw new bindings.MojoCodecError( | 39 default: |
| 40 'Bad value $v for enum Enum.'); | 40 return null; |
| 41 } | 41 } |
| 42 return result; | 42 } |
| 43 } | 43 |
| 44 | 44 static SystemUiVisibility decode(bindings.Decoder decoder0, int offset) { |
| 45 String toString() { | 45 int v = decoder0.decodeUint32(offset); |
| 46 switch(this) { | 46 SystemUiVisibility result = new SystemUiVisibility(v); |
| 47 case VALUE: | 47 if (result == null) { |
| 48 return 'Enum.VALUE'; | 48 throw new bindings.MojoCodecError( |
| 49 } | 49 'Bad value $v for enum SystemUiVisibility.'); |
| 50 } | 50 } |
| 51 | 51 return result; |
| 52 int toJson() => value; | 52 } |
| 53 } | 53 |
| 54 | 54 String toString() { |
| 55 | 55 switch(this) { |
| 56 | 56 case STANDARD: |
| 57 class ProviderEchoStringParams extends bindings.Struct { | 57 return 'SystemUiVisibility.STANDARD'; |
| 58 case FULLSCREEN: |
| 59 return 'SystemUiVisibility.FULLSCREEN'; |
| 60 case IMMERSIVE: |
| 61 return 'SystemUiVisibility.IMMERSIVE'; |
| 62 } |
| 63 } |
| 64 |
| 65 int toJson() => value; |
| 66 } |
| 67 class ScreenOrientation extends bindings.MojoEnum { |
| 68 static const UNSPECIFIED = const ScreenOrientation._(0); |
| 69 static const LANDSCAPE = const ScreenOrientation._(1); |
| 70 static const PORTRAIT = const ScreenOrientation._(2); |
| 71 static const NOSENSOR = const ScreenOrientation._(3); |
| 72 |
| 73 const ScreenOrientation._(int v) : super(v); |
| 74 |
| 75 static const Map<String, ScreenOrientation> valuesMap = const { |
| 76 "UNSPECIFIED": UNSPECIFIED, |
| 77 "LANDSCAPE": LANDSCAPE, |
| 78 "PORTRAIT": PORTRAIT, |
| 79 "NOSENSOR": NOSENSOR, |
| 80 }; |
| 81 static const List<ScreenOrientation> values = const [ |
| 82 UNSPECIFIED, |
| 83 LANDSCAPE, |
| 84 PORTRAIT, |
| 85 NOSENSOR, |
| 86 ]; |
| 87 |
| 88 static ScreenOrientation valueOf(String name) => valuesMap[name]; |
| 89 |
| 90 factory ScreenOrientation(int v) { |
| 91 switch (v) { |
| 92 case 0: |
| 93 return UNSPECIFIED; |
| 94 case 1: |
| 95 return LANDSCAPE; |
| 96 case 2: |
| 97 return PORTRAIT; |
| 98 case 3: |
| 99 return NOSENSOR; |
| 100 default: |
| 101 return null; |
| 102 } |
| 103 } |
| 104 |
| 105 static ScreenOrientation decode(bindings.Decoder decoder0, int offset) { |
| 106 int v = decoder0.decodeUint32(offset); |
| 107 ScreenOrientation result = new ScreenOrientation(v); |
| 108 if (result == null) { |
| 109 throw new bindings.MojoCodecError( |
| 110 'Bad value $v for enum ScreenOrientation.'); |
| 111 } |
| 112 return result; |
| 113 } |
| 114 |
| 115 String toString() { |
| 116 switch(this) { |
| 117 case UNSPECIFIED: |
| 118 return 'ScreenOrientation.UNSPECIFIED'; |
| 119 case LANDSCAPE: |
| 120 return 'ScreenOrientation.LANDSCAPE'; |
| 121 case PORTRAIT: |
| 122 return 'ScreenOrientation.PORTRAIT'; |
| 123 case NOSENSOR: |
| 124 return 'ScreenOrientation.NOSENSOR'; |
| 125 } |
| 126 } |
| 127 |
| 128 int toJson() => value; |
| 129 } |
| 130 class HapticFeedbackType extends bindings.MojoEnum { |
| 131 static const LONG_PRESS = const HapticFeedbackType._(0); |
| 132 static const VIRTUAL_KEY = const HapticFeedbackType._(1); |
| 133 static const KEYBOARD_TAP = const HapticFeedbackType._(2); |
| 134 static const CLOCK_TICK = const HapticFeedbackType._(3); |
| 135 |
| 136 const HapticFeedbackType._(int v) : super(v); |
| 137 |
| 138 static const Map<String, HapticFeedbackType> valuesMap = const { |
| 139 "LONG_PRESS": LONG_PRESS, |
| 140 "VIRTUAL_KEY": VIRTUAL_KEY, |
| 141 "KEYBOARD_TAP": KEYBOARD_TAP, |
| 142 "CLOCK_TICK": CLOCK_TICK, |
| 143 }; |
| 144 static const List<HapticFeedbackType> values = const [ |
| 145 LONG_PRESS, |
| 146 VIRTUAL_KEY, |
| 147 KEYBOARD_TAP, |
| 148 CLOCK_TICK, |
| 149 ]; |
| 150 |
| 151 static HapticFeedbackType valueOf(String name) => valuesMap[name]; |
| 152 |
| 153 factory HapticFeedbackType(int v) { |
| 154 switch (v) { |
| 155 case 0: |
| 156 return LONG_PRESS; |
| 157 case 1: |
| 158 return VIRTUAL_KEY; |
| 159 case 2: |
| 160 return KEYBOARD_TAP; |
| 161 case 3: |
| 162 return CLOCK_TICK; |
| 163 default: |
| 164 return null; |
| 165 } |
| 166 } |
| 167 |
| 168 static HapticFeedbackType decode(bindings.Decoder decoder0, int offset) { |
| 169 int v = decoder0.decodeUint32(offset); |
| 170 HapticFeedbackType result = new HapticFeedbackType(v); |
| 171 if (result == null) { |
| 172 throw new bindings.MojoCodecError( |
| 173 'Bad value $v for enum HapticFeedbackType.'); |
| 174 } |
| 175 return result; |
| 176 } |
| 177 |
| 178 String toString() { |
| 179 switch(this) { |
| 180 case LONG_PRESS: |
| 181 return 'HapticFeedbackType.LONG_PRESS'; |
| 182 case VIRTUAL_KEY: |
| 183 return 'HapticFeedbackType.VIRTUAL_KEY'; |
| 184 case KEYBOARD_TAP: |
| 185 return 'HapticFeedbackType.KEYBOARD_TAP'; |
| 186 case CLOCK_TICK: |
| 187 return 'HapticFeedbackType.CLOCK_TICK'; |
| 188 } |
| 189 } |
| 190 |
| 191 int toJson() => value; |
| 192 } |
| 193 class AuralFeedbackType extends bindings.MojoEnum { |
| 194 static const CLICK = const AuralFeedbackType._(0); |
| 195 static const NAVIGATION_LEFT = const AuralFeedbackType._(1); |
| 196 static const NAVIGATION_UP = const AuralFeedbackType._(2); |
| 197 static const NAVIGATION_RIGHT = const AuralFeedbackType._(3); |
| 198 static const NAVIGATION_DOWN = const AuralFeedbackType._(4); |
| 199 |
| 200 const AuralFeedbackType._(int v) : super(v); |
| 201 |
| 202 static const Map<String, AuralFeedbackType> valuesMap = const { |
| 203 "CLICK": CLICK, |
| 204 "NAVIGATION_LEFT": NAVIGATION_LEFT, |
| 205 "NAVIGATION_UP": NAVIGATION_UP, |
| 206 "NAVIGATION_RIGHT": NAVIGATION_RIGHT, |
| 207 "NAVIGATION_DOWN": NAVIGATION_DOWN, |
| 208 }; |
| 209 static const List<AuralFeedbackType> values = const [ |
| 210 CLICK, |
| 211 NAVIGATION_LEFT, |
| 212 NAVIGATION_UP, |
| 213 NAVIGATION_RIGHT, |
| 214 NAVIGATION_DOWN, |
| 215 ]; |
| 216 |
| 217 static AuralFeedbackType valueOf(String name) => valuesMap[name]; |
| 218 |
| 219 factory AuralFeedbackType(int v) { |
| 220 switch (v) { |
| 221 case 0: |
| 222 return CLICK; |
| 223 case 1: |
| 224 return NAVIGATION_LEFT; |
| 225 case 2: |
| 226 return NAVIGATION_UP; |
| 227 case 3: |
| 228 return NAVIGATION_RIGHT; |
| 229 case 4: |
| 230 return NAVIGATION_DOWN; |
| 231 default: |
| 232 return null; |
| 233 } |
| 234 } |
| 235 |
| 236 static AuralFeedbackType decode(bindings.Decoder decoder0, int offset) { |
| 237 int v = decoder0.decodeUint32(offset); |
| 238 AuralFeedbackType result = new AuralFeedbackType(v); |
| 239 if (result == null) { |
| 240 throw new bindings.MojoCodecError( |
| 241 'Bad value $v for enum AuralFeedbackType.'); |
| 242 } |
| 243 return result; |
| 244 } |
| 245 |
| 246 String toString() { |
| 247 switch(this) { |
| 248 case CLICK: |
| 249 return 'AuralFeedbackType.CLICK'; |
| 250 case NAVIGATION_LEFT: |
| 251 return 'AuralFeedbackType.NAVIGATION_LEFT'; |
| 252 case NAVIGATION_UP: |
| 253 return 'AuralFeedbackType.NAVIGATION_UP'; |
| 254 case NAVIGATION_RIGHT: |
| 255 return 'AuralFeedbackType.NAVIGATION_RIGHT'; |
| 256 case NAVIGATION_DOWN: |
| 257 return 'AuralFeedbackType.NAVIGATION_DOWN'; |
| 258 } |
| 259 } |
| 260 |
| 261 int toJson() => value; |
| 262 } |
| 263 |
| 264 |
| 265 |
| 266 class StringExtra extends bindings.Struct { |
| 58 static const List<bindings.StructDataHeader> kVersions = const [ | 267 static const List<bindings.StructDataHeader> kVersions = const [ |
| 59 const bindings.StructDataHeader(16, 0) | 268 const bindings.StructDataHeader(24, 0) |
| 60 ]; | 269 ]; |
| 61 String a = null; | 270 String name = null; |
| 62 | 271 String value = null; |
| 63 ProviderEchoStringParams() : super(kVersions.last.size); | 272 |
| 64 | 273 StringExtra() : super(kVersions.last.size); |
| 65 static ProviderEchoStringParams deserialize(bindings.Message message) { | 274 |
| 275 static StringExtra deserialize(bindings.Message message) { |
| 66 var decoder = new bindings.Decoder(message); | 276 var decoder = new bindings.Decoder(message); |
| 67 var result = decode(decoder); | 277 var result = decode(decoder); |
| 68 if (decoder.excessHandles != null) { | 278 if (decoder.excessHandles != null) { |
| 69 decoder.excessHandles.forEach((h) => h.close()); | 279 decoder.excessHandles.forEach((h) => h.close()); |
| 70 } | 280 } |
| 71 return result; | 281 return result; |
| 72 } | 282 } |
| 73 | 283 |
| 74 static ProviderEchoStringParams decode(bindings.Decoder decoder0) { | 284 static StringExtra decode(bindings.Decoder decoder0) { |
| 75 if (decoder0 == null) { | 285 if (decoder0 == null) { |
| 76 return null; | 286 return null; |
| 77 } | 287 } |
| 78 ProviderEchoStringParams result = new ProviderEchoStringParams(); | 288 StringExtra result = new StringExtra(); |
| 79 | 289 |
| 80 var mainDataHeader = decoder0.decodeStructDataHeader(); | 290 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 81 if (mainDataHeader.version <= kVersions.last.version) { | 291 if (mainDataHeader.version <= kVersions.last.version) { |
| 82 // Scan in reverse order to optimize for more recent versions. | 292 // Scan in reverse order to optimize for more recent versions. |
| 83 for (int i = kVersions.length - 1; i >= 0; --i) { | 293 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 84 if (mainDataHeader.version >= kVersions[i].version) { | 294 if (mainDataHeader.version >= kVersions[i].version) { |
| 85 if (mainDataHeader.size == kVersions[i].size) { | 295 if (mainDataHeader.size == kVersions[i].size) { |
| 86 // Found a match. | 296 // Found a match. |
| 87 break; | 297 break; |
| 88 } | 298 } |
| 89 throw new bindings.MojoCodecError( | 299 throw new bindings.MojoCodecError( |
| 90 'Header size doesn\'t correspond to known version size.'); | 300 'Header size doesn\'t correspond to known version size.'); |
| 91 } | 301 } |
| 92 } | 302 } |
| 93 } else if (mainDataHeader.size < kVersions.last.size) { | 303 } else if (mainDataHeader.size < kVersions.last.size) { |
| 94 throw new bindings.MojoCodecError( | 304 throw new bindings.MojoCodecError( |
| 95 'Message newer than the last known version cannot be shorter than ' | 305 'Message newer than the last known version cannot be shorter than ' |
| 96 'required by the last known version.'); | 306 'required by the last known version.'); |
| 97 } | 307 } |
| 98 if (mainDataHeader.version >= 0) { | 308 if (mainDataHeader.version >= 0) { |
| 99 | 309 |
| 100 result.a = decoder0.decodeString(8, false); | 310 result.name = decoder0.decodeString(8, false); |
| 311 } |
| 312 if (mainDataHeader.version >= 0) { |
| 313 |
| 314 result.value = decoder0.decodeString(16, false); |
| 101 } | 315 } |
| 102 return result; | 316 return result; |
| 103 } | 317 } |
| 104 | 318 |
| 105 void encode(bindings.Encoder encoder) { | 319 void encode(bindings.Encoder encoder) { |
| 106 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 320 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 107 | 321 |
| 108 encoder0.encodeString(a, 8, false); | 322 encoder0.encodeString(name, 8, false); |
| 323 |
| 324 encoder0.encodeString(value, 16, false); |
| 109 } | 325 } |
| 110 | 326 |
| 111 String toString() { | 327 String toString() { |
| 112 return "ProviderEchoStringParams(" | 328 return "StringExtra(" |
| 113 "a: $a" ")"; | 329 "name: $name" ", " |
| 330 "value: $value" ")"; |
| 114 } | 331 } |
| 115 | 332 |
| 116 Map toJson() { | 333 Map toJson() { |
| 117 Map map = new Map(); | 334 Map map = new Map(); |
| 118 map["a"] = a; | 335 map["name"] = name; |
| 336 map["value"] = value; |
| 119 return map; | 337 return map; |
| 120 } | 338 } |
| 121 } | 339 } |
| 122 | 340 |
| 123 | 341 |
| 124 class ProviderEchoStringResponseParams extends bindings.Struct { | 342 class ComponentName extends bindings.Struct { |
| 125 static const List<bindings.StructDataHeader> kVersions = const [ | 343 static const List<bindings.StructDataHeader> kVersions = const [ |
| 126 const bindings.StructDataHeader(16, 0) | 344 const bindings.StructDataHeader(24, 0) |
| 127 ]; | 345 ]; |
| 128 String a = null; | 346 String packageName = null; |
| 347 String className = null; |
| 129 | 348 |
| 130 ProviderEchoStringResponseParams() : super(kVersions.last.size); | 349 ComponentName() : super(kVersions.last.size); |
| 131 | 350 |
| 132 static ProviderEchoStringResponseParams deserialize(bindings.Message message)
{ | 351 static ComponentName deserialize(bindings.Message message) { |
| 133 var decoder = new bindings.Decoder(message); | 352 var decoder = new bindings.Decoder(message); |
| 134 var result = decode(decoder); | 353 var result = decode(decoder); |
| 135 if (decoder.excessHandles != null) { | 354 if (decoder.excessHandles != null) { |
| 136 decoder.excessHandles.forEach((h) => h.close()); | 355 decoder.excessHandles.forEach((h) => h.close()); |
| 137 } | 356 } |
| 138 return result; | 357 return result; |
| 139 } | 358 } |
| 140 | 359 |
| 141 static ProviderEchoStringResponseParams decode(bindings.Decoder decoder0) { | 360 static ComponentName decode(bindings.Decoder decoder0) { |
| 142 if (decoder0 == null) { | 361 if (decoder0 == null) { |
| 143 return null; | 362 return null; |
| 144 } | 363 } |
| 145 ProviderEchoStringResponseParams result = new ProviderEchoStringResponsePara
ms(); | 364 ComponentName result = new ComponentName(); |
| 146 | 365 |
| 147 var mainDataHeader = decoder0.decodeStructDataHeader(); | 366 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 148 if (mainDataHeader.version <= kVersions.last.version) { | 367 if (mainDataHeader.version <= kVersions.last.version) { |
| 149 // Scan in reverse order to optimize for more recent versions. | 368 // Scan in reverse order to optimize for more recent versions. |
| 150 for (int i = kVersions.length - 1; i >= 0; --i) { | 369 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 151 if (mainDataHeader.version >= kVersions[i].version) { | 370 if (mainDataHeader.version >= kVersions[i].version) { |
| 152 if (mainDataHeader.size == kVersions[i].size) { | 371 if (mainDataHeader.size == kVersions[i].size) { |
| 153 // Found a match. | 372 // Found a match. |
| 154 break; | 373 break; |
| 155 } | 374 } |
| 156 throw new bindings.MojoCodecError( | 375 throw new bindings.MojoCodecError( |
| 157 'Header size doesn\'t correspond to known version size.'); | 376 'Header size doesn\'t correspond to known version size.'); |
| 158 } | 377 } |
| 159 } | 378 } |
| 160 } else if (mainDataHeader.size < kVersions.last.size) { | 379 } else if (mainDataHeader.size < kVersions.last.size) { |
| 161 throw new bindings.MojoCodecError( | 380 throw new bindings.MojoCodecError( |
| 162 'Message newer than the last known version cannot be shorter than ' | 381 'Message newer than the last known version cannot be shorter than ' |
| 163 'required by the last known version.'); | 382 'required by the last known version.'); |
| 164 } | 383 } |
| 165 if (mainDataHeader.version >= 0) { | 384 if (mainDataHeader.version >= 0) { |
| 166 | 385 |
| 167 result.a = decoder0.decodeString(8, false); | 386 result.packageName = decoder0.decodeString(8, false); |
| 387 } |
| 388 if (mainDataHeader.version >= 0) { |
| 389 |
| 390 result.className = decoder0.decodeString(16, false); |
| 168 } | 391 } |
| 169 return result; | 392 return result; |
| 170 } | 393 } |
| 171 | 394 |
| 172 void encode(bindings.Encoder encoder) { | 395 void encode(bindings.Encoder encoder) { |
| 173 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 396 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 174 | 397 |
| 175 encoder0.encodeString(a, 8, false); | 398 encoder0.encodeString(packageName, 8, false); |
| 399 |
| 400 encoder0.encodeString(className, 16, false); |
| 176 } | 401 } |
| 177 | 402 |
| 178 String toString() { | 403 String toString() { |
| 179 return "ProviderEchoStringResponseParams(" | 404 return "ComponentName(" |
| 180 "a: $a" ")"; | 405 "packageName: $packageName" ", " |
| 406 "className: $className" ")"; |
| 181 } | 407 } |
| 182 | 408 |
| 183 Map toJson() { | 409 Map toJson() { |
| 184 Map map = new Map(); | 410 Map map = new Map(); |
| 185 map["a"] = a; | 411 map["packageName"] = packageName; |
| 412 map["className"] = className; |
| 186 return map; | 413 return map; |
| 187 } | 414 } |
| 188 } | 415 } |
| 189 | 416 |
| 190 | 417 |
| 191 class ProviderEchoStringsParams extends bindings.Struct { | 418 class Intent extends bindings.Struct { |
| 192 static const List<bindings.StructDataHeader> kVersions = const [ | 419 static const List<bindings.StructDataHeader> kVersions = const [ |
| 193 const bindings.StructDataHeader(24, 0) | 420 const bindings.StructDataHeader(48, 0) |
| 194 ]; | 421 ]; |
| 195 String a = null; | 422 String action = null; |
| 196 String b = null; | 423 String url = null; |
| 424 int flags = 0; |
| 425 ComponentName component = null; |
| 426 List<StringExtra> stringExtras = null; |
| 197 | 427 |
| 198 ProviderEchoStringsParams() : super(kVersions.last.size); | 428 Intent() : super(kVersions.last.size); |
| 199 | 429 |
| 200 static ProviderEchoStringsParams deserialize(bindings.Message message) { | 430 static Intent deserialize(bindings.Message message) { |
| 201 var decoder = new bindings.Decoder(message); | 431 var decoder = new bindings.Decoder(message); |
| 202 var result = decode(decoder); | 432 var result = decode(decoder); |
| 203 if (decoder.excessHandles != null) { | 433 if (decoder.excessHandles != null) { |
| 204 decoder.excessHandles.forEach((h) => h.close()); | 434 decoder.excessHandles.forEach((h) => h.close()); |
| 205 } | 435 } |
| 206 return result; | 436 return result; |
| 207 } | 437 } |
| 208 | 438 |
| 209 static ProviderEchoStringsParams decode(bindings.Decoder decoder0) { | 439 static Intent decode(bindings.Decoder decoder0) { |
| 210 if (decoder0 == null) { | 440 if (decoder0 == null) { |
| 211 return null; | 441 return null; |
| 212 } | 442 } |
| 213 ProviderEchoStringsParams result = new ProviderEchoStringsParams(); | 443 Intent result = new Intent(); |
| 214 | 444 |
| 215 var mainDataHeader = decoder0.decodeStructDataHeader(); | 445 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 216 if (mainDataHeader.version <= kVersions.last.version) { | 446 if (mainDataHeader.version <= kVersions.last.version) { |
| 217 // Scan in reverse order to optimize for more recent versions. | 447 // Scan in reverse order to optimize for more recent versions. |
| 218 for (int i = kVersions.length - 1; i >= 0; --i) { | 448 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 219 if (mainDataHeader.version >= kVersions[i].version) { | 449 if (mainDataHeader.version >= kVersions[i].version) { |
| 220 if (mainDataHeader.size == kVersions[i].size) { | 450 if (mainDataHeader.size == kVersions[i].size) { |
| 221 // Found a match. | 451 // Found a match. |
| 222 break; | 452 break; |
| 223 } | 453 } |
| 224 throw new bindings.MojoCodecError( | 454 throw new bindings.MojoCodecError( |
| 225 'Header size doesn\'t correspond to known version size.'); | 455 'Header size doesn\'t correspond to known version size.'); |
| 226 } | 456 } |
| 227 } | 457 } |
| 228 } else if (mainDataHeader.size < kVersions.last.size) { | 458 } else if (mainDataHeader.size < kVersions.last.size) { |
| 229 throw new bindings.MojoCodecError( | 459 throw new bindings.MojoCodecError( |
| 230 'Message newer than the last known version cannot be shorter than ' | 460 'Message newer than the last known version cannot be shorter than ' |
| 231 'required by the last known version.'); | 461 'required by the last known version.'); |
| 232 } | 462 } |
| 233 if (mainDataHeader.version >= 0) { | 463 if (mainDataHeader.version >= 0) { |
| 234 | 464 |
| 235 result.a = decoder0.decodeString(8, false); | 465 result.action = decoder0.decodeString(8, false); |
| 236 } | 466 } |
| 237 if (mainDataHeader.version >= 0) { | 467 if (mainDataHeader.version >= 0) { |
| 238 | 468 |
| 239 result.b = decoder0.decodeString(16, false); | 469 result.url = decoder0.decodeString(16, false); |
| 470 } |
| 471 if (mainDataHeader.version >= 0) { |
| 472 |
| 473 result.flags = decoder0.decodeUint32(24); |
| 474 } |
| 475 if (mainDataHeader.version >= 0) { |
| 476 |
| 477 var decoder1 = decoder0.decodePointer(32, true); |
| 478 result.component = ComponentName.decode(decoder1); |
| 479 } |
| 480 if (mainDataHeader.version >= 0) { |
| 481 |
| 482 var decoder1 = decoder0.decodePointer(40, true); |
| 483 if (decoder1 == null) { |
| 484 result.stringExtras = null; |
| 485 } else { |
| 486 var si1 = decoder1.decodeDataHeaderForPointerArray(bindings.kUnspecified
ArrayLength); |
| 487 result.stringExtras = new List<StringExtra>(si1.numElements); |
| 488 for (int i1 = 0; i1 < si1.numElements; ++i1) { |
| 489 |
| 490 var decoder2 = decoder1.decodePointer(bindings.ArrayDataHeader.kHeader
Size + bindings.kPointerSize * i1, false); |
| 491 result.stringExtras[i1] = StringExtra.decode(decoder2); |
| 492 } |
| 493 } |
| 240 } | 494 } |
| 241 return result; | 495 return result; |
| 242 } | 496 } |
| 243 | 497 |
| 244 void encode(bindings.Encoder encoder) { | 498 void encode(bindings.Encoder encoder) { |
| 245 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 499 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 246 | 500 |
| 247 encoder0.encodeString(a, 8, false); | 501 encoder0.encodeString(action, 8, false); |
| 248 | 502 |
| 249 encoder0.encodeString(b, 16, false); | 503 encoder0.encodeString(url, 16, false); |
| 504 |
| 505 encoder0.encodeUint32(flags, 24); |
| 506 |
| 507 encoder0.encodeStruct(component, 32, true); |
| 508 |
| 509 if (stringExtras == null) { |
| 510 encoder0.encodeNullPointer(40, true); |
| 511 } else { |
| 512 var encoder1 = encoder0.encodePointerArray(stringExtras.length, 40, bindin
gs.kUnspecifiedArrayLength); |
| 513 for (int i0 = 0; i0 < stringExtras.length; ++i0) { |
| 514 |
| 515 encoder1.encodeStruct(stringExtras[i0], bindings.ArrayDataHeader.kHeader
Size + bindings.kPointerSize * i0, false); |
| 516 } |
| 517 } |
| 250 } | 518 } |
| 251 | 519 |
| 252 String toString() { | 520 String toString() { |
| 253 return "ProviderEchoStringsParams(" | 521 return "Intent(" |
| 254 "a: $a" ", " | 522 "action: $action" ", " |
| 255 "b: $b" ")"; | 523 "url: $url" ", " |
| 524 "flags: $flags" ", " |
| 525 "component: $component" ", " |
| 526 "stringExtras: $stringExtras" ")"; |
| 256 } | 527 } |
| 257 | 528 |
| 258 Map toJson() { | 529 Map toJson() { |
| 259 Map map = new Map(); | 530 Map map = new Map(); |
| 260 map["a"] = a; | 531 map["action"] = action; |
| 261 map["b"] = b; | 532 map["url"] = url; |
| 533 map["flags"] = flags; |
| 534 map["component"] = component; |
| 535 map["stringExtras"] = stringExtras; |
| 262 return map; | 536 return map; |
| 263 } | 537 } |
| 264 } | 538 } |
| 265 | 539 |
| 266 | 540 |
| 267 class ProviderEchoStringsResponseParams extends bindings.Struct { | 541 class TaskDescription extends bindings.Struct { |
| 268 static const List<bindings.StructDataHeader> kVersions = const [ | 542 static const List<bindings.StructDataHeader> kVersions = const [ |
| 269 const bindings.StructDataHeader(24, 0) | 543 const bindings.StructDataHeader(24, 0) |
| 270 ]; | 544 ]; |
| 271 String a = null; | 545 String label = null; |
| 272 String b = null; | 546 int primaryColor = 0; |
| 273 | 547 |
| 274 ProviderEchoStringsResponseParams() : super(kVersions.last.size); | 548 TaskDescription() : super(kVersions.last.size); |
| 275 | 549 |
| 276 static ProviderEchoStringsResponseParams deserialize(bindings.Message message)
{ | 550 static TaskDescription deserialize(bindings.Message message) { |
| 277 var decoder = new bindings.Decoder(message); | 551 var decoder = new bindings.Decoder(message); |
| 278 var result = decode(decoder); | 552 var result = decode(decoder); |
| 279 if (decoder.excessHandles != null) { | 553 if (decoder.excessHandles != null) { |
| 280 decoder.excessHandles.forEach((h) => h.close()); | 554 decoder.excessHandles.forEach((h) => h.close()); |
| 281 } | 555 } |
| 282 return result; | 556 return result; |
| 283 } | 557 } |
| 284 | 558 |
| 285 static ProviderEchoStringsResponseParams decode(bindings.Decoder decoder0) { | 559 static TaskDescription decode(bindings.Decoder decoder0) { |
| 286 if (decoder0 == null) { | 560 if (decoder0 == null) { |
| 287 return null; | 561 return null; |
| 288 } | 562 } |
| 289 ProviderEchoStringsResponseParams result = new ProviderEchoStringsResponsePa
rams(); | 563 TaskDescription result = new TaskDescription(); |
| 290 | 564 |
| 291 var mainDataHeader = decoder0.decodeStructDataHeader(); | 565 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 292 if (mainDataHeader.version <= kVersions.last.version) { | 566 if (mainDataHeader.version <= kVersions.last.version) { |
| 293 // Scan in reverse order to optimize for more recent versions. | 567 // Scan in reverse order to optimize for more recent versions. |
| 294 for (int i = kVersions.length - 1; i >= 0; --i) { | 568 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 295 if (mainDataHeader.version >= kVersions[i].version) { | 569 if (mainDataHeader.version >= kVersions[i].version) { |
| 296 if (mainDataHeader.size == kVersions[i].size) { | 570 if (mainDataHeader.size == kVersions[i].size) { |
| 297 // Found a match. | 571 // Found a match. |
| 298 break; | 572 break; |
| 299 } | 573 } |
| 300 throw new bindings.MojoCodecError( | 574 throw new bindings.MojoCodecError( |
| 301 'Header size doesn\'t correspond to known version size.'); | 575 'Header size doesn\'t correspond to known version size.'); |
| 302 } | 576 } |
| 303 } | 577 } |
| 304 } else if (mainDataHeader.size < kVersions.last.size) { | 578 } else if (mainDataHeader.size < kVersions.last.size) { |
| 305 throw new bindings.MojoCodecError( | 579 throw new bindings.MojoCodecError( |
| 306 'Message newer than the last known version cannot be shorter than ' | 580 'Message newer than the last known version cannot be shorter than ' |
| 307 'required by the last known version.'); | 581 'required by the last known version.'); |
| 308 } | 582 } |
| 309 if (mainDataHeader.version >= 0) { | 583 if (mainDataHeader.version >= 0) { |
| 310 | 584 |
| 311 result.a = decoder0.decodeString(8, false); | 585 result.label = decoder0.decodeString(8, true); |
| 312 } | 586 } |
| 313 if (mainDataHeader.version >= 0) { | 587 if (mainDataHeader.version >= 0) { |
| 314 | 588 |
| 315 result.b = decoder0.decodeString(16, false); | 589 result.primaryColor = decoder0.decodeUint32(16); |
| 316 } | 590 } |
| 317 return result; | 591 return result; |
| 318 } | 592 } |
| 319 | 593 |
| 320 void encode(bindings.Encoder encoder) { | 594 void encode(bindings.Encoder encoder) { |
| 321 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 595 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 322 | 596 |
| 323 encoder0.encodeString(a, 8, false); | 597 encoder0.encodeString(label, 8, true); |
| 324 | 598 |
| 325 encoder0.encodeString(b, 16, false); | 599 encoder0.encodeUint32(primaryColor, 16); |
| 326 } | 600 } |
| 327 | 601 |
| 328 String toString() { | 602 String toString() { |
| 329 return "ProviderEchoStringsResponseParams(" | 603 return "TaskDescription(" |
| 330 "a: $a" ", " | 604 "label: $label" ", " |
| 331 "b: $b" ")"; | 605 "primaryColor: $primaryColor" ")"; |
| 332 } | 606 } |
| 333 | 607 |
| 334 Map toJson() { | 608 Map toJson() { |
| 335 Map map = new Map(); | 609 Map map = new Map(); |
| 336 map["a"] = a; | 610 map["label"] = label; |
| 337 map["b"] = b; | 611 map["primaryColor"] = primaryColor; |
| 338 return map; | 612 return map; |
| 339 } | 613 } |
| 340 } | 614 } |
| 341 | 615 |
| 342 | 616 |
| 343 class ProviderEchoMessagePipeHandleParams extends bindings.Struct { | 617 class ActivityGetUserFeedbackParams extends bindings.Struct { |
| 344 static const List<bindings.StructDataHeader> kVersions = const [ | 618 static const List<bindings.StructDataHeader> kVersions = const [ |
| 345 const bindings.StructDataHeader(16, 0) | 619 const bindings.StructDataHeader(16, 0) |
| 346 ]; | 620 ]; |
| 347 core.MojoMessagePipeEndpoint a = null; | 621 Object userFeedback = null; |
| 348 | 622 |
| 349 ProviderEchoMessagePipeHandleParams() : super(kVersions.last.size); | 623 ActivityGetUserFeedbackParams() : super(kVersions.last.size); |
| 350 | 624 |
| 351 static ProviderEchoMessagePipeHandleParams deserialize(bindings.Message messag
e) { | 625 static ActivityGetUserFeedbackParams deserialize(bindings.Message message) { |
| 352 var decoder = new bindings.Decoder(message); | 626 var decoder = new bindings.Decoder(message); |
| 353 var result = decode(decoder); | 627 var result = decode(decoder); |
| 354 if (decoder.excessHandles != null) { | 628 if (decoder.excessHandles != null) { |
| 355 decoder.excessHandles.forEach((h) => h.close()); | 629 decoder.excessHandles.forEach((h) => h.close()); |
| 356 } | 630 } |
| 357 return result; | 631 return result; |
| 358 } | 632 } |
| 359 | 633 |
| 360 static ProviderEchoMessagePipeHandleParams decode(bindings.Decoder decoder0) { | 634 static ActivityGetUserFeedbackParams decode(bindings.Decoder decoder0) { |
| 361 if (decoder0 == null) { | 635 if (decoder0 == null) { |
| 362 return null; | 636 return null; |
| 363 } | 637 } |
| 364 ProviderEchoMessagePipeHandleParams result = new ProviderEchoMessagePipeHand
leParams(); | 638 ActivityGetUserFeedbackParams result = new ActivityGetUserFeedbackParams(); |
| 365 | 639 |
| 366 var mainDataHeader = decoder0.decodeStructDataHeader(); | 640 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 367 if (mainDataHeader.version <= kVersions.last.version) { | 641 if (mainDataHeader.version <= kVersions.last.version) { |
| 368 // Scan in reverse order to optimize for more recent versions. | 642 // Scan in reverse order to optimize for more recent versions. |
| 369 for (int i = kVersions.length - 1; i >= 0; --i) { | 643 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 370 if (mainDataHeader.version >= kVersions[i].version) { | 644 if (mainDataHeader.version >= kVersions[i].version) { |
| 371 if (mainDataHeader.size == kVersions[i].size) { | 645 if (mainDataHeader.size == kVersions[i].size) { |
| 372 // Found a match. | 646 // Found a match. |
| 373 break; | 647 break; |
| 374 } | 648 } |
| 375 throw new bindings.MojoCodecError( | 649 throw new bindings.MojoCodecError( |
| 376 'Header size doesn\'t correspond to known version size.'); | 650 'Header size doesn\'t correspond to known version size.'); |
| 377 } | 651 } |
| 378 } | 652 } |
| 379 } else if (mainDataHeader.size < kVersions.last.size) { | 653 } else if (mainDataHeader.size < kVersions.last.size) { |
| 380 throw new bindings.MojoCodecError( | 654 throw new bindings.MojoCodecError( |
| 381 'Message newer than the last known version cannot be shorter than ' | 655 'Message newer than the last known version cannot be shorter than ' |
| 382 'required by the last known version.'); | 656 'required by the last known version.'); |
| 383 } | 657 } |
| 384 if (mainDataHeader.version >= 0) { | 658 if (mainDataHeader.version >= 0) { |
| 385 | 659 |
| 386 result.a = decoder0.decodeMessagePipeHandle(8, false); | 660 result.userFeedback = decoder0.decodeInterfaceRequest(8, false, UserFeedba
ckStub.newFromEndpoint); |
| 387 } | 661 } |
| 388 return result; | 662 return result; |
| 389 } | 663 } |
| 390 | 664 |
| 391 void encode(bindings.Encoder encoder) { | 665 void encode(bindings.Encoder encoder) { |
| 392 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 666 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 393 | 667 |
| 394 encoder0.encodeMessagePipeHandle(a, 8, false); | 668 encoder0.encodeInterfaceRequest(userFeedback, 8, false); |
| 395 } | 669 } |
| 396 | 670 |
| 397 String toString() { | 671 String toString() { |
| 398 return "ProviderEchoMessagePipeHandleParams(" | 672 return "ActivityGetUserFeedbackParams(" |
| 399 "a: $a" ")"; | 673 "userFeedback: $userFeedback" ")"; |
| 400 } | 674 } |
| 401 | 675 |
| 402 Map toJson() { | 676 Map toJson() { |
| 403 throw new bindings.MojoCodecError( | 677 throw new bindings.MojoCodecError( |
| 404 'Object containing handles cannot be encoded to JSON.'); | 678 'Object containing handles cannot be encoded to JSON.'); |
| 405 } | 679 } |
| 406 } | 680 } |
| 407 | 681 |
| 408 | 682 |
| 409 class ProviderEchoMessagePipeHandleResponseParams extends bindings.Struct { | 683 class ActivityStartActivityParams extends bindings.Struct { |
| 410 static const List<bindings.StructDataHeader> kVersions = const [ | 684 static const List<bindings.StructDataHeader> kVersions = const [ |
| 411 const bindings.StructDataHeader(16, 0) | 685 const bindings.StructDataHeader(16, 0) |
| 412 ]; | 686 ]; |
| 413 core.MojoMessagePipeEndpoint a = null; | 687 Intent intent = null; |
| 414 | 688 |
| 415 ProviderEchoMessagePipeHandleResponseParams() : super(kVersions.last.size); | 689 ActivityStartActivityParams() : super(kVersions.last.size); |
| 416 | 690 |
| 417 static ProviderEchoMessagePipeHandleResponseParams deserialize(bindings.Messag
e message) { | 691 static ActivityStartActivityParams deserialize(bindings.Message message) { |
| 418 var decoder = new bindings.Decoder(message); | 692 var decoder = new bindings.Decoder(message); |
| 419 var result = decode(decoder); | 693 var result = decode(decoder); |
| 420 if (decoder.excessHandles != null) { | 694 if (decoder.excessHandles != null) { |
| 421 decoder.excessHandles.forEach((h) => h.close()); | 695 decoder.excessHandles.forEach((h) => h.close()); |
| 422 } | 696 } |
| 423 return result; | 697 return result; |
| 424 } | 698 } |
| 425 | 699 |
| 426 static ProviderEchoMessagePipeHandleResponseParams decode(bindings.Decoder dec
oder0) { | 700 static ActivityStartActivityParams decode(bindings.Decoder decoder0) { |
| 427 if (decoder0 == null) { | 701 if (decoder0 == null) { |
| 428 return null; | 702 return null; |
| 429 } | 703 } |
| 430 ProviderEchoMessagePipeHandleResponseParams result = new ProviderEchoMessage
PipeHandleResponseParams(); | 704 ActivityStartActivityParams result = new ActivityStartActivityParams(); |
| 431 | 705 |
| 432 var mainDataHeader = decoder0.decodeStructDataHeader(); | 706 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 433 if (mainDataHeader.version <= kVersions.last.version) { | 707 if (mainDataHeader.version <= kVersions.last.version) { |
| 434 // Scan in reverse order to optimize for more recent versions. | 708 // Scan in reverse order to optimize for more recent versions. |
| 435 for (int i = kVersions.length - 1; i >= 0; --i) { | 709 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 436 if (mainDataHeader.version >= kVersions[i].version) { | 710 if (mainDataHeader.version >= kVersions[i].version) { |
| 437 if (mainDataHeader.size == kVersions[i].size) { | 711 if (mainDataHeader.size == kVersions[i].size) { |
| 438 // Found a match. | 712 // Found a match. |
| 439 break; | 713 break; |
| 440 } | 714 } |
| 441 throw new bindings.MojoCodecError( | 715 throw new bindings.MojoCodecError( |
| 442 'Header size doesn\'t correspond to known version size.'); | 716 'Header size doesn\'t correspond to known version size.'); |
| 443 } | 717 } |
| 444 } | 718 } |
| 445 } else if (mainDataHeader.size < kVersions.last.size) { | 719 } else if (mainDataHeader.size < kVersions.last.size) { |
| 446 throw new bindings.MojoCodecError( | 720 throw new bindings.MojoCodecError( |
| 447 'Message newer than the last known version cannot be shorter than ' | 721 'Message newer than the last known version cannot be shorter than ' |
| 448 'required by the last known version.'); | 722 'required by the last known version.'); |
| 449 } | 723 } |
| 450 if (mainDataHeader.version >= 0) { | 724 if (mainDataHeader.version >= 0) { |
| 451 | 725 |
| 452 result.a = decoder0.decodeMessagePipeHandle(8, false); | 726 var decoder1 = decoder0.decodePointer(8, false); |
| 727 result.intent = Intent.decode(decoder1); |
| 453 } | 728 } |
| 454 return result; | 729 return result; |
| 455 } | 730 } |
| 456 | 731 |
| 457 void encode(bindings.Encoder encoder) { | 732 void encode(bindings.Encoder encoder) { |
| 458 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 733 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 459 | 734 |
| 460 encoder0.encodeMessagePipeHandle(a, 8, false); | 735 encoder0.encodeStruct(intent, 8, false); |
| 461 } | 736 } |
| 462 | 737 |
| 463 String toString() { | 738 String toString() { |
| 464 return "ProviderEchoMessagePipeHandleResponseParams(" | 739 return "ActivityStartActivityParams(" |
| 465 "a: $a" ")"; | 740 "intent: $intent" ")"; |
| 466 } | 741 } |
| 467 | 742 |
| 468 Map toJson() { | 743 Map toJson() { |
| 469 throw new bindings.MojoCodecError( | 744 Map map = new Map(); |
| 470 'Object containing handles cannot be encoded to JSON.'); | 745 map["intent"] = intent; |
| 746 return map; |
| 471 } | 747 } |
| 472 } | 748 } |
| 473 | 749 |
| 474 | 750 |
| 475 class ProviderEchoEnumParams extends bindings.Struct { | 751 class ActivityFinishCurrentActivityParams extends bindings.Struct { |
| 476 static const List<bindings.StructDataHeader> kVersions = const [ | 752 static const List<bindings.StructDataHeader> kVersions = const [ |
| 477 const bindings.StructDataHeader(16, 0) | 753 const bindings.StructDataHeader(8, 0) |
| 478 ]; | 754 ]; |
| 479 Enum a = null; | |
| 480 | 755 |
| 481 ProviderEchoEnumParams() : super(kVersions.last.size); | 756 ActivityFinishCurrentActivityParams() : super(kVersions.last.size); |
| 482 | 757 |
| 483 static ProviderEchoEnumParams deserialize(bindings.Message message) { | 758 static ActivityFinishCurrentActivityParams deserialize(bindings.Message messag
e) { |
| 484 var decoder = new bindings.Decoder(message); | 759 var decoder = new bindings.Decoder(message); |
| 485 var result = decode(decoder); | 760 var result = decode(decoder); |
| 486 if (decoder.excessHandles != null) { | 761 if (decoder.excessHandles != null) { |
| 487 decoder.excessHandles.forEach((h) => h.close()); | 762 decoder.excessHandles.forEach((h) => h.close()); |
| 488 } | 763 } |
| 489 return result; | 764 return result; |
| 490 } | 765 } |
| 491 | 766 |
| 492 static ProviderEchoEnumParams decode(bindings.Decoder decoder0) { | 767 static ActivityFinishCurrentActivityParams decode(bindings.Decoder decoder0) { |
| 493 if (decoder0 == null) { | 768 if (decoder0 == null) { |
| 494 return null; | 769 return null; |
| 495 } | 770 } |
| 496 ProviderEchoEnumParams result = new ProviderEchoEnumParams(); | 771 ActivityFinishCurrentActivityParams result = new ActivityFinishCurrentActivi
tyParams(); |
| 497 | 772 |
| 498 var mainDataHeader = decoder0.decodeStructDataHeader(); | 773 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 499 if (mainDataHeader.version <= kVersions.last.version) { | 774 if (mainDataHeader.version <= kVersions.last.version) { |
| 500 // Scan in reverse order to optimize for more recent versions. | 775 // Scan in reverse order to optimize for more recent versions. |
| 501 for (int i = kVersions.length - 1; i >= 0; --i) { | 776 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 502 if (mainDataHeader.version >= kVersions[i].version) { | 777 if (mainDataHeader.version >= kVersions[i].version) { |
| 503 if (mainDataHeader.size == kVersions[i].size) { | 778 if (mainDataHeader.size == kVersions[i].size) { |
| 504 // Found a match. | 779 // Found a match. |
| 505 break; | 780 break; |
| 506 } | 781 } |
| 507 throw new bindings.MojoCodecError( | 782 throw new bindings.MojoCodecError( |
| 508 'Header size doesn\'t correspond to known version size.'); | 783 'Header size doesn\'t correspond to known version size.'); |
| 509 } | 784 } |
| 510 } | 785 } |
| 511 } else if (mainDataHeader.size < kVersions.last.size) { | 786 } else if (mainDataHeader.size < kVersions.last.size) { |
| 512 throw new bindings.MojoCodecError( | 787 throw new bindings.MojoCodecError( |
| 513 'Message newer than the last known version cannot be shorter than ' | 788 'Message newer than the last known version cannot be shorter than ' |
| 514 'required by the last known version.'); | 789 'required by the last known version.'); |
| 515 } | 790 } |
| 516 if (mainDataHeader.version >= 0) { | |
| 517 | |
| 518 result.a = Enum.decode(decoder0, 8); | |
| 519 if (result.a == null) { | |
| 520 throw new bindings.MojoCodecError( | |
| 521 'Trying to decode null union for non-nullable Enum.'); | |
| 522 } | |
| 523 } | |
| 524 return result; | 791 return result; |
| 525 } | 792 } |
| 526 | 793 |
| 527 void encode(bindings.Encoder encoder) { | 794 void encode(bindings.Encoder encoder) { |
| 528 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 795 encoder.getStructEncoderAtOffset(kVersions.last); |
| 529 | |
| 530 encoder0.encodeEnum(a, 8); | |
| 531 } | 796 } |
| 532 | 797 |
| 533 String toString() { | 798 String toString() { |
| 534 return "ProviderEchoEnumParams(" | 799 return "ActivityFinishCurrentActivityParams("")"; |
| 535 "a: $a" ")"; | |
| 536 } | 800 } |
| 537 | 801 |
| 538 Map toJson() { | 802 Map toJson() { |
| 539 Map map = new Map(); | 803 Map map = new Map(); |
| 540 map["a"] = a; | |
| 541 return map; | 804 return map; |
| 542 } | 805 } |
| 543 } | 806 } |
| 544 | 807 |
| 545 | 808 |
| 546 class ProviderEchoEnumResponseParams extends bindings.Struct { | 809 class ActivitySetTaskDescriptionParams extends bindings.Struct { |
| 547 static const List<bindings.StructDataHeader> kVersions = const [ | 810 static const List<bindings.StructDataHeader> kVersions = const [ |
| 548 const bindings.StructDataHeader(16, 0) | 811 const bindings.StructDataHeader(16, 0) |
| 549 ]; | 812 ]; |
| 550 Enum a = null; | 813 TaskDescription description = null; |
| 551 | 814 |
| 552 ProviderEchoEnumResponseParams() : super(kVersions.last.size); | 815 ActivitySetTaskDescriptionParams() : super(kVersions.last.size); |
| 553 | 816 |
| 554 static ProviderEchoEnumResponseParams deserialize(bindings.Message message) { | 817 static ActivitySetTaskDescriptionParams deserialize(bindings.Message message)
{ |
| 555 var decoder = new bindings.Decoder(message); | 818 var decoder = new bindings.Decoder(message); |
| 556 var result = decode(decoder); | 819 var result = decode(decoder); |
| 557 if (decoder.excessHandles != null) { | 820 if (decoder.excessHandles != null) { |
| 558 decoder.excessHandles.forEach((h) => h.close()); | 821 decoder.excessHandles.forEach((h) => h.close()); |
| 559 } | 822 } |
| 560 return result; | 823 return result; |
| 561 } | 824 } |
| 562 | 825 |
| 563 static ProviderEchoEnumResponseParams decode(bindings.Decoder decoder0) { | 826 static ActivitySetTaskDescriptionParams decode(bindings.Decoder decoder0) { |
| 564 if (decoder0 == null) { | 827 if (decoder0 == null) { |
| 565 return null; | 828 return null; |
| 566 } | 829 } |
| 567 ProviderEchoEnumResponseParams result = new ProviderEchoEnumResponseParams()
; | 830 ActivitySetTaskDescriptionParams result = new ActivitySetTaskDescriptionPara
ms(); |
| 568 | 831 |
| 569 var mainDataHeader = decoder0.decodeStructDataHeader(); | 832 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 570 if (mainDataHeader.version <= kVersions.last.version) { | 833 if (mainDataHeader.version <= kVersions.last.version) { |
| 571 // Scan in reverse order to optimize for more recent versions. | 834 // Scan in reverse order to optimize for more recent versions. |
| 572 for (int i = kVersions.length - 1; i >= 0; --i) { | 835 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 573 if (mainDataHeader.version >= kVersions[i].version) { | 836 if (mainDataHeader.version >= kVersions[i].version) { |
| 574 if (mainDataHeader.size == kVersions[i].size) { | 837 if (mainDataHeader.size == kVersions[i].size) { |
| 575 // Found a match. | 838 // Found a match. |
| 576 break; | 839 break; |
| 577 } | 840 } |
| 578 throw new bindings.MojoCodecError( | 841 throw new bindings.MojoCodecError( |
| 579 'Header size doesn\'t correspond to known version size.'); | 842 'Header size doesn\'t correspond to known version size.'); |
| 580 } | 843 } |
| 581 } | 844 } |
| 582 } else if (mainDataHeader.size < kVersions.last.size) { | 845 } else if (mainDataHeader.size < kVersions.last.size) { |
| 583 throw new bindings.MojoCodecError( | 846 throw new bindings.MojoCodecError( |
| 584 'Message newer than the last known version cannot be shorter than ' | 847 'Message newer than the last known version cannot be shorter than ' |
| 585 'required by the last known version.'); | 848 'required by the last known version.'); |
| 586 } | 849 } |
| 587 if (mainDataHeader.version >= 0) { | 850 if (mainDataHeader.version >= 0) { |
| 588 | 851 |
| 589 result.a = Enum.decode(decoder0, 8); | 852 var decoder1 = decoder0.decodePointer(8, false); |
| 590 if (result.a == null) { | 853 result.description = TaskDescription.decode(decoder1); |
| 591 throw new bindings.MojoCodecError( | |
| 592 'Trying to decode null union for non-nullable Enum.'); | |
| 593 } | |
| 594 } | 854 } |
| 595 return result; | 855 return result; |
| 596 } | 856 } |
| 597 | 857 |
| 598 void encode(bindings.Encoder encoder) { | 858 void encode(bindings.Encoder encoder) { |
| 599 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 859 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 600 | 860 |
| 601 encoder0.encodeEnum(a, 8); | 861 encoder0.encodeStruct(description, 8, false); |
| 602 } | 862 } |
| 603 | 863 |
| 604 String toString() { | 864 String toString() { |
| 605 return "ProviderEchoEnumResponseParams(" | 865 return "ActivitySetTaskDescriptionParams(" |
| 606 "a: $a" ")"; | 866 "description: $description" ")"; |
| 607 } | 867 } |
| 608 | 868 |
| 609 Map toJson() { | 869 Map toJson() { |
| 610 Map map = new Map(); | 870 Map map = new Map(); |
| 611 map["a"] = a; | 871 map["description"] = description; |
| 612 return map; | 872 return map; |
| 613 } | 873 } |
| 614 } | 874 } |
| 615 | 875 |
| 616 | 876 |
| 617 class ProviderEchoIntParams extends bindings.Struct { | 877 class ActivitySetSystemUiVisibilityParams extends bindings.Struct { |
| 618 static const List<bindings.StructDataHeader> kVersions = const [ | 878 static const List<bindings.StructDataHeader> kVersions = const [ |
| 619 const bindings.StructDataHeader(16, 0) | 879 const bindings.StructDataHeader(16, 0) |
| 620 ]; | 880 ]; |
| 621 int a = 0; | 881 SystemUiVisibility visibility = null; |
| 622 | 882 |
| 623 ProviderEchoIntParams() : super(kVersions.last.size); | 883 ActivitySetSystemUiVisibilityParams() : super(kVersions.last.size); |
| 624 | 884 |
| 625 static ProviderEchoIntParams deserialize(bindings.Message message) { | 885 static ActivitySetSystemUiVisibilityParams deserialize(bindings.Message messag
e) { |
| 626 var decoder = new bindings.Decoder(message); | 886 var decoder = new bindings.Decoder(message); |
| 627 var result = decode(decoder); | 887 var result = decode(decoder); |
| 628 if (decoder.excessHandles != null) { | 888 if (decoder.excessHandles != null) { |
| 629 decoder.excessHandles.forEach((h) => h.close()); | 889 decoder.excessHandles.forEach((h) => h.close()); |
| 630 } | 890 } |
| 631 return result; | 891 return result; |
| 632 } | 892 } |
| 633 | 893 |
| 634 static ProviderEchoIntParams decode(bindings.Decoder decoder0) { | 894 static ActivitySetSystemUiVisibilityParams decode(bindings.Decoder decoder0) { |
| 635 if (decoder0 == null) { | 895 if (decoder0 == null) { |
| 636 return null; | 896 return null; |
| 637 } | 897 } |
| 638 ProviderEchoIntParams result = new ProviderEchoIntParams(); | 898 ActivitySetSystemUiVisibilityParams result = new ActivitySetSystemUiVisibili
tyParams(); |
| 639 | 899 |
| 640 var mainDataHeader = decoder0.decodeStructDataHeader(); | 900 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 641 if (mainDataHeader.version <= kVersions.last.version) { | 901 if (mainDataHeader.version <= kVersions.last.version) { |
| 642 // Scan in reverse order to optimize for more recent versions. | 902 // Scan in reverse order to optimize for more recent versions. |
| 643 for (int i = kVersions.length - 1; i >= 0; --i) { | 903 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 644 if (mainDataHeader.version >= kVersions[i].version) { | 904 if (mainDataHeader.version >= kVersions[i].version) { |
| 645 if (mainDataHeader.size == kVersions[i].size) { | 905 if (mainDataHeader.size == kVersions[i].size) { |
| 646 // Found a match. | 906 // Found a match. |
| 647 break; | 907 break; |
| 648 } | 908 } |
| 649 throw new bindings.MojoCodecError( | 909 throw new bindings.MojoCodecError( |
| 650 'Header size doesn\'t correspond to known version size.'); | 910 'Header size doesn\'t correspond to known version size.'); |
| 651 } | 911 } |
| 652 } | 912 } |
| 653 } else if (mainDataHeader.size < kVersions.last.size) { | 913 } else if (mainDataHeader.size < kVersions.last.size) { |
| 654 throw new bindings.MojoCodecError( | 914 throw new bindings.MojoCodecError( |
| 655 'Message newer than the last known version cannot be shorter than ' | 915 'Message newer than the last known version cannot be shorter than ' |
| 656 'required by the last known version.'); | 916 'required by the last known version.'); |
| 657 } | 917 } |
| 658 if (mainDataHeader.version >= 0) { | 918 if (mainDataHeader.version >= 0) { |
| 659 | 919 |
| 660 result.a = decoder0.decodeInt32(8); | 920 result.visibility = SystemUiVisibility.decode(decoder0, 8); |
| 921 if (result.visibility == null) { |
| 922 throw new bindings.MojoCodecError( |
| 923 'Trying to decode null union for non-nullable SystemUiVisibility.'); |
| 924 } |
| 661 } | 925 } |
| 662 return result; | 926 return result; |
| 663 } | 927 } |
| 664 | 928 |
| 665 void encode(bindings.Encoder encoder) { | 929 void encode(bindings.Encoder encoder) { |
| 666 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 930 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 667 | 931 |
| 668 encoder0.encodeInt32(a, 8); | 932 encoder0.encodeEnum(visibility, 8); |
| 669 } | 933 } |
| 670 | 934 |
| 671 String toString() { | 935 String toString() { |
| 672 return "ProviderEchoIntParams(" | 936 return "ActivitySetSystemUiVisibilityParams(" |
| 673 "a: $a" ")"; | 937 "visibility: $visibility" ")"; |
| 674 } | 938 } |
| 675 | 939 |
| 676 Map toJson() { | 940 Map toJson() { |
| 677 Map map = new Map(); | 941 Map map = new Map(); |
| 678 map["a"] = a; | 942 map["visibility"] = visibility; |
| 679 return map; | 943 return map; |
| 680 } | 944 } |
| 681 } | 945 } |
| 682 | 946 |
| 683 | 947 |
| 684 class ProviderEchoIntResponseParams extends bindings.Struct { | 948 class ActivitySetRequestedOrientationParams extends bindings.Struct { |
| 685 static const List<bindings.StructDataHeader> kVersions = const [ | 949 static const List<bindings.StructDataHeader> kVersions = const [ |
| 686 const bindings.StructDataHeader(16, 0) | 950 const bindings.StructDataHeader(16, 0) |
| 687 ]; | 951 ]; |
| 688 int a = 0; | 952 ScreenOrientation orientation = null; |
| 689 | 953 |
| 690 ProviderEchoIntResponseParams() : super(kVersions.last.size); | 954 ActivitySetRequestedOrientationParams() : super(kVersions.last.size); |
| 691 | 955 |
| 692 static ProviderEchoIntResponseParams deserialize(bindings.Message message) { | 956 static ActivitySetRequestedOrientationParams deserialize(bindings.Message mess
age) { |
| 693 var decoder = new bindings.Decoder(message); | 957 var decoder = new bindings.Decoder(message); |
| 694 var result = decode(decoder); | 958 var result = decode(decoder); |
| 695 if (decoder.excessHandles != null) { | 959 if (decoder.excessHandles != null) { |
| 696 decoder.excessHandles.forEach((h) => h.close()); | 960 decoder.excessHandles.forEach((h) => h.close()); |
| 697 } | 961 } |
| 698 return result; | 962 return result; |
| 699 } | 963 } |
| 700 | 964 |
| 701 static ProviderEchoIntResponseParams decode(bindings.Decoder decoder0) { | 965 static ActivitySetRequestedOrientationParams decode(bindings.Decoder decoder0)
{ |
| 702 if (decoder0 == null) { | 966 if (decoder0 == null) { |
| 703 return null; | 967 return null; |
| 704 } | 968 } |
| 705 ProviderEchoIntResponseParams result = new ProviderEchoIntResponseParams(); | 969 ActivitySetRequestedOrientationParams result = new ActivitySetRequestedOrien
tationParams(); |
| 706 | 970 |
| 707 var mainDataHeader = decoder0.decodeStructDataHeader(); | 971 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 708 if (mainDataHeader.version <= kVersions.last.version) { | 972 if (mainDataHeader.version <= kVersions.last.version) { |
| 709 // Scan in reverse order to optimize for more recent versions. | 973 // Scan in reverse order to optimize for more recent versions. |
| 710 for (int i = kVersions.length - 1; i >= 0; --i) { | 974 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 711 if (mainDataHeader.version >= kVersions[i].version) { | 975 if (mainDataHeader.version >= kVersions[i].version) { |
| 712 if (mainDataHeader.size == kVersions[i].size) { | 976 if (mainDataHeader.size == kVersions[i].size) { |
| 713 // Found a match. | 977 // Found a match. |
| 714 break; | 978 break; |
| 715 } | 979 } |
| 716 throw new bindings.MojoCodecError( | 980 throw new bindings.MojoCodecError( |
| 717 'Header size doesn\'t correspond to known version size.'); | 981 'Header size doesn\'t correspond to known version size.'); |
| 718 } | 982 } |
| 719 } | 983 } |
| 720 } else if (mainDataHeader.size < kVersions.last.size) { | 984 } else if (mainDataHeader.size < kVersions.last.size) { |
| 721 throw new bindings.MojoCodecError( | 985 throw new bindings.MojoCodecError( |
| 722 'Message newer than the last known version cannot be shorter than ' | 986 'Message newer than the last known version cannot be shorter than ' |
| 723 'required by the last known version.'); | 987 'required by the last known version.'); |
| 724 } | 988 } |
| 725 if (mainDataHeader.version >= 0) { | 989 if (mainDataHeader.version >= 0) { |
| 726 | 990 |
| 727 result.a = decoder0.decodeInt32(8); | 991 result.orientation = ScreenOrientation.decode(decoder0, 8); |
| 992 if (result.orientation == null) { |
| 993 throw new bindings.MojoCodecError( |
| 994 'Trying to decode null union for non-nullable ScreenOrientation.'); |
| 995 } |
| 728 } | 996 } |
| 729 return result; | 997 return result; |
| 730 } | 998 } |
| 731 | 999 |
| 732 void encode(bindings.Encoder encoder) { | 1000 void encode(bindings.Encoder encoder) { |
| 733 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 1001 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 734 | 1002 |
| 735 encoder0.encodeInt32(a, 8); | 1003 encoder0.encodeEnum(orientation, 8); |
| 736 } | 1004 } |
| 737 | 1005 |
| 738 String toString() { | 1006 String toString() { |
| 739 return "ProviderEchoIntResponseParams(" | 1007 return "ActivitySetRequestedOrientationParams(" |
| 740 "a: $a" ")"; | 1008 "orientation: $orientation" ")"; |
| 741 } | 1009 } |
| 742 | 1010 |
| 743 Map toJson() { | 1011 Map toJson() { |
| 744 Map map = new Map(); | 1012 Map map = new Map(); |
| 745 map["a"] = a; | 1013 map["orientation"] = orientation; |
| 746 return map; | 1014 return map; |
| 747 } | 1015 } |
| 748 } | 1016 } |
| 749 | 1017 |
| 750 | 1018 |
| 751 class IntegerAccessorGetIntegerParams extends bindings.Struct { | 1019 class PathServiceGetAppDataDirParams extends bindings.Struct { |
| 752 static const List<bindings.StructDataHeader> kVersions = const [ | 1020 static const List<bindings.StructDataHeader> kVersions = const [ |
| 753 const bindings.StructDataHeader(8, 0) | 1021 const bindings.StructDataHeader(8, 0) |
| 754 ]; | 1022 ]; |
| 755 | 1023 |
| 756 IntegerAccessorGetIntegerParams() : super(kVersions.last.size); | 1024 PathServiceGetAppDataDirParams() : super(kVersions.last.size); |
| 757 | 1025 |
| 758 static IntegerAccessorGetIntegerParams deserialize(bindings.Message message) { | 1026 static PathServiceGetAppDataDirParams deserialize(bindings.Message message) { |
| 759 var decoder = new bindings.Decoder(message); | 1027 var decoder = new bindings.Decoder(message); |
| 760 var result = decode(decoder); | 1028 var result = decode(decoder); |
| 761 if (decoder.excessHandles != null) { | 1029 if (decoder.excessHandles != null) { |
| 762 decoder.excessHandles.forEach((h) => h.close()); | 1030 decoder.excessHandles.forEach((h) => h.close()); |
| 763 } | 1031 } |
| 764 return result; | 1032 return result; |
| 765 } | 1033 } |
| 766 | 1034 |
| 767 static IntegerAccessorGetIntegerParams decode(bindings.Decoder decoder0) { | 1035 static PathServiceGetAppDataDirParams decode(bindings.Decoder decoder0) { |
| 768 if (decoder0 == null) { | 1036 if (decoder0 == null) { |
| 769 return null; | 1037 return null; |
| 770 } | 1038 } |
| 771 IntegerAccessorGetIntegerParams result = new IntegerAccessorGetIntegerParams
(); | 1039 PathServiceGetAppDataDirParams result = new PathServiceGetAppDataDirParams()
; |
| 772 | 1040 |
| 773 var mainDataHeader = decoder0.decodeStructDataHeader(); | 1041 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 774 if (mainDataHeader.version <= kVersions.last.version) { | 1042 if (mainDataHeader.version <= kVersions.last.version) { |
| 775 // Scan in reverse order to optimize for more recent versions. | 1043 // Scan in reverse order to optimize for more recent versions. |
| 776 for (int i = kVersions.length - 1; i >= 0; --i) { | 1044 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 777 if (mainDataHeader.version >= kVersions[i].version) { | 1045 if (mainDataHeader.version >= kVersions[i].version) { |
| 778 if (mainDataHeader.size == kVersions[i].size) { | 1046 if (mainDataHeader.size == kVersions[i].size) { |
| 779 // Found a match. | 1047 // Found a match. |
| 780 break; | 1048 break; |
| 781 } | 1049 } |
| 782 throw new bindings.MojoCodecError( | 1050 throw new bindings.MojoCodecError( |
| 783 'Header size doesn\'t correspond to known version size.'); | 1051 'Header size doesn\'t correspond to known version size.'); |
| 784 } | 1052 } |
| 785 } | 1053 } |
| 786 } else if (mainDataHeader.size < kVersions.last.size) { | 1054 } else if (mainDataHeader.size < kVersions.last.size) { |
| 787 throw new bindings.MojoCodecError( | 1055 throw new bindings.MojoCodecError( |
| 788 'Message newer than the last known version cannot be shorter than ' | 1056 'Message newer than the last known version cannot be shorter than ' |
| 789 'required by the last known version.'); | 1057 'required by the last known version.'); |
| 790 } | 1058 } |
| 791 return result; | 1059 return result; |
| 792 } | 1060 } |
| 793 | 1061 |
| 794 void encode(bindings.Encoder encoder) { | 1062 void encode(bindings.Encoder encoder) { |
| 795 encoder.getStructEncoderAtOffset(kVersions.last); | 1063 encoder.getStructEncoderAtOffset(kVersions.last); |
| 796 } | 1064 } |
| 797 | 1065 |
| 798 String toString() { | 1066 String toString() { |
| 799 return "IntegerAccessorGetIntegerParams("")"; | 1067 return "PathServiceGetAppDataDirParams("")"; |
| 800 } | 1068 } |
| 801 | 1069 |
| 802 Map toJson() { | 1070 Map toJson() { |
| 803 Map map = new Map(); | 1071 Map map = new Map(); |
| 804 return map; | 1072 return map; |
| 805 } | 1073 } |
| 806 } | 1074 } |
| 807 | 1075 |
| 808 | 1076 |
| 809 class IntegerAccessorGetIntegerResponseParams extends bindings.Struct { | 1077 class PathServiceGetAppDataDirResponseParams extends bindings.Struct { |
| 810 static const List<bindings.StructDataHeader> kVersions = const [ | 1078 static const List<bindings.StructDataHeader> kVersions = const [ |
| 811 const bindings.StructDataHeader(16, 0), | 1079 const bindings.StructDataHeader(16, 0) |
| 812 const bindings.StructDataHeader(24, 2) | |
| 813 ]; | 1080 ]; |
| 814 int data = 0; | 1081 String path = null; |
| 815 Enum type = null; | |
| 816 | 1082 |
| 817 IntegerAccessorGetIntegerResponseParams() : super(kVersions.last.size); | 1083 PathServiceGetAppDataDirResponseParams() : super(kVersions.last.size); |
| 818 | 1084 |
| 819 static IntegerAccessorGetIntegerResponseParams deserialize(bindings.Message me
ssage) { | 1085 static PathServiceGetAppDataDirResponseParams deserialize(bindings.Message mes
sage) { |
| 820 var decoder = new bindings.Decoder(message); | 1086 var decoder = new bindings.Decoder(message); |
| 821 var result = decode(decoder); | 1087 var result = decode(decoder); |
| 822 if (decoder.excessHandles != null) { | 1088 if (decoder.excessHandles != null) { |
| 823 decoder.excessHandles.forEach((h) => h.close()); | 1089 decoder.excessHandles.forEach((h) => h.close()); |
| 824 } | 1090 } |
| 825 return result; | 1091 return result; |
| 826 } | 1092 } |
| 827 | 1093 |
| 828 static IntegerAccessorGetIntegerResponseParams decode(bindings.Decoder decoder
0) { | 1094 static PathServiceGetAppDataDirResponseParams decode(bindings.Decoder decoder0
) { |
| 829 if (decoder0 == null) { | 1095 if (decoder0 == null) { |
| 830 return null; | 1096 return null; |
| 831 } | 1097 } |
| 832 IntegerAccessorGetIntegerResponseParams result = new IntegerAccessorGetInteg
erResponseParams(); | 1098 PathServiceGetAppDataDirResponseParams result = new PathServiceGetAppDataDir
ResponseParams(); |
| 833 | 1099 |
| 834 var mainDataHeader = decoder0.decodeStructDataHeader(); | 1100 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 835 if (mainDataHeader.version <= kVersions.last.version) { | 1101 if (mainDataHeader.version <= kVersions.last.version) { |
| 836 // Scan in reverse order to optimize for more recent versions. | 1102 // Scan in reverse order to optimize for more recent versions. |
| 837 for (int i = kVersions.length - 1; i >= 0; --i) { | 1103 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 838 if (mainDataHeader.version >= kVersions[i].version) { | 1104 if (mainDataHeader.version >= kVersions[i].version) { |
| 839 if (mainDataHeader.size == kVersions[i].size) { | 1105 if (mainDataHeader.size == kVersions[i].size) { |
| 840 // Found a match. | 1106 // Found a match. |
| 841 break; | 1107 break; |
| 842 } | 1108 } |
| 843 throw new bindings.MojoCodecError( | 1109 throw new bindings.MojoCodecError( |
| 844 'Header size doesn\'t correspond to known version size.'); | 1110 'Header size doesn\'t correspond to known version size.'); |
| 845 } | 1111 } |
| 846 } | 1112 } |
| 847 } else if (mainDataHeader.size < kVersions.last.size) { | 1113 } else if (mainDataHeader.size < kVersions.last.size) { |
| 848 throw new bindings.MojoCodecError( | 1114 throw new bindings.MojoCodecError( |
| 849 'Message newer than the last known version cannot be shorter than ' | 1115 'Message newer than the last known version cannot be shorter than ' |
| 850 'required by the last known version.'); | 1116 'required by the last known version.'); |
| 851 } | 1117 } |
| 852 if (mainDataHeader.version >= 0) { | 1118 if (mainDataHeader.version >= 0) { |
| 853 | 1119 |
| 854 result.data = decoder0.decodeInt64(8); | 1120 result.path = decoder0.decodeString(8, false); |
| 855 } | |
| 856 if (mainDataHeader.version >= 2) { | |
| 857 | |
| 858 result.type = Enum.decode(decoder0, 16); | |
| 859 if (result.type == null) { | |
| 860 throw new bindings.MojoCodecError( | |
| 861 'Trying to decode null union for non-nullable Enum.'); | |
| 862 } | |
| 863 } | 1121 } |
| 864 return result; | 1122 return result; |
| 865 } | 1123 } |
| 866 | 1124 |
| 867 void encode(bindings.Encoder encoder) { | 1125 void encode(bindings.Encoder encoder) { |
| 868 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 1126 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 869 | 1127 |
| 870 encoder0.encodeInt64(data, 8); | 1128 encoder0.encodeString(path, 8, false); |
| 871 | |
| 872 encoder0.encodeEnum(type, 16); | |
| 873 } | 1129 } |
| 874 | 1130 |
| 875 String toString() { | 1131 String toString() { |
| 876 return "IntegerAccessorGetIntegerResponseParams(" | 1132 return "PathServiceGetAppDataDirResponseParams(" |
| 877 "data: $data" ", " | 1133 "path: $path" ")"; |
| 878 "type: $type" ")"; | |
| 879 } | 1134 } |
| 880 | 1135 |
| 881 Map toJson() { | 1136 Map toJson() { |
| 882 Map map = new Map(); | 1137 Map map = new Map(); |
| 883 map["data"] = data; | 1138 map["path"] = path; |
| 884 map["type"] = type; | |
| 885 return map; | 1139 return map; |
| 886 } | 1140 } |
| 887 } | 1141 } |
| 888 | 1142 |
| 889 | 1143 |
| 890 class IntegerAccessorSetIntegerParams extends bindings.Struct { | 1144 class PathServiceGetFilesDirParams extends bindings.Struct { |
| 891 static const List<bindings.StructDataHeader> kVersions = const [ | 1145 static const List<bindings.StructDataHeader> kVersions = const [ |
| 892 const bindings.StructDataHeader(16, 0), | 1146 const bindings.StructDataHeader(8, 0) |
| 893 const bindings.StructDataHeader(24, 3) | |
| 894 ]; | 1147 ]; |
| 895 int data = 0; | |
| 896 Enum type = null; | |
| 897 | 1148 |
| 898 IntegerAccessorSetIntegerParams() : super(kVersions.last.size); | 1149 PathServiceGetFilesDirParams() : super(kVersions.last.size); |
| 899 | 1150 |
| 900 static IntegerAccessorSetIntegerParams deserialize(bindings.Message message) { | 1151 static PathServiceGetFilesDirParams deserialize(bindings.Message message) { |
| 901 var decoder = new bindings.Decoder(message); | 1152 var decoder = new bindings.Decoder(message); |
| 902 var result = decode(decoder); | 1153 var result = decode(decoder); |
| 903 if (decoder.excessHandles != null) { | 1154 if (decoder.excessHandles != null) { |
| 904 decoder.excessHandles.forEach((h) => h.close()); | 1155 decoder.excessHandles.forEach((h) => h.close()); |
| 905 } | 1156 } |
| 906 return result; | 1157 return result; |
| 907 } | 1158 } |
| 908 | 1159 |
| 909 static IntegerAccessorSetIntegerParams decode(bindings.Decoder decoder0) { | 1160 static PathServiceGetFilesDirParams decode(bindings.Decoder decoder0) { |
| 910 if (decoder0 == null) { | 1161 if (decoder0 == null) { |
| 911 return null; | 1162 return null; |
| 912 } | 1163 } |
| 913 IntegerAccessorSetIntegerParams result = new IntegerAccessorSetIntegerParams
(); | 1164 PathServiceGetFilesDirParams result = new PathServiceGetFilesDirParams(); |
| 914 | 1165 |
| 915 var mainDataHeader = decoder0.decodeStructDataHeader(); | 1166 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 916 if (mainDataHeader.version <= kVersions.last.version) { | 1167 if (mainDataHeader.version <= kVersions.last.version) { |
| 917 // Scan in reverse order to optimize for more recent versions. | 1168 // Scan in reverse order to optimize for more recent versions. |
| 918 for (int i = kVersions.length - 1; i >= 0; --i) { | 1169 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 919 if (mainDataHeader.version >= kVersions[i].version) { | 1170 if (mainDataHeader.version >= kVersions[i].version) { |
| 920 if (mainDataHeader.size == kVersions[i].size) { | 1171 if (mainDataHeader.size == kVersions[i].size) { |
| 921 // Found a match. | 1172 // Found a match. |
| 922 break; | 1173 break; |
| 923 } | 1174 } |
| 924 throw new bindings.MojoCodecError( | 1175 throw new bindings.MojoCodecError( |
| 925 'Header size doesn\'t correspond to known version size.'); | 1176 'Header size doesn\'t correspond to known version size.'); |
| 926 } | 1177 } |
| 927 } | 1178 } |
| 928 } else if (mainDataHeader.size < kVersions.last.size) { | 1179 } else if (mainDataHeader.size < kVersions.last.size) { |
| 929 throw new bindings.MojoCodecError( | 1180 throw new bindings.MojoCodecError( |
| 930 'Message newer than the last known version cannot be shorter than ' | 1181 'Message newer than the last known version cannot be shorter than ' |
| 931 'required by the last known version.'); | 1182 'required by the last known version.'); |
| 932 } | 1183 } |
| 933 if (mainDataHeader.version >= 0) { | |
| 934 | |
| 935 result.data = decoder0.decodeInt64(8); | |
| 936 } | |
| 937 if (mainDataHeader.version >= 3) { | |
| 938 | |
| 939 result.type = Enum.decode(decoder0, 16); | |
| 940 if (result.type == null) { | |
| 941 throw new bindings.MojoCodecError( | |
| 942 'Trying to decode null union for non-nullable Enum.'); | |
| 943 } | |
| 944 } | |
| 945 return result; | 1184 return result; |
| 946 } | 1185 } |
| 947 | 1186 |
| 948 void encode(bindings.Encoder encoder) { | 1187 void encode(bindings.Encoder encoder) { |
| 949 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 1188 encoder.getStructEncoderAtOffset(kVersions.last); |
| 950 | |
| 951 encoder0.encodeInt64(data, 8); | |
| 952 | |
| 953 encoder0.encodeEnum(type, 16); | |
| 954 } | 1189 } |
| 955 | 1190 |
| 956 String toString() { | 1191 String toString() { |
| 957 return "IntegerAccessorSetIntegerParams(" | 1192 return "PathServiceGetFilesDirParams("")"; |
| 958 "data: $data" ", " | |
| 959 "type: $type" ")"; | |
| 960 } | 1193 } |
| 961 | 1194 |
| 962 Map toJson() { | 1195 Map toJson() { |
| 963 Map map = new Map(); | 1196 Map map = new Map(); |
| 964 map["data"] = data; | |
| 965 map["type"] = type; | |
| 966 return map; | 1197 return map; |
| 967 } | 1198 } |
| 968 } | 1199 } |
| 969 | 1200 |
| 970 | 1201 |
| 971 class SampleInterfaceSampleMethod1Params extends bindings.Struct { | 1202 class PathServiceGetFilesDirResponseParams extends bindings.Struct { |
| 972 static const List<bindings.StructDataHeader> kVersions = const [ | 1203 static const List<bindings.StructDataHeader> kVersions = const [ |
| 973 const bindings.StructDataHeader(24, 0) | 1204 const bindings.StructDataHeader(16, 0) |
| 974 ]; | 1205 ]; |
| 975 int in1 = 0; | 1206 String path = null; |
| 976 String in2 = null; | |
| 977 | 1207 |
| 978 SampleInterfaceSampleMethod1Params() : super(kVersions.last.size); | 1208 PathServiceGetFilesDirResponseParams() : super(kVersions.last.size); |
| 979 | 1209 |
| 980 static SampleInterfaceSampleMethod1Params deserialize(bindings.Message message
) { | 1210 static PathServiceGetFilesDirResponseParams deserialize(bindings.Message messa
ge) { |
| 981 var decoder = new bindings.Decoder(message); | 1211 var decoder = new bindings.Decoder(message); |
| 982 var result = decode(decoder); | 1212 var result = decode(decoder); |
| 983 if (decoder.excessHandles != null) { | 1213 if (decoder.excessHandles != null) { |
| 984 decoder.excessHandles.forEach((h) => h.close()); | 1214 decoder.excessHandles.forEach((h) => h.close()); |
| 985 } | 1215 } |
| 986 return result; | 1216 return result; |
| 987 } | 1217 } |
| 988 | 1218 |
| 989 static SampleInterfaceSampleMethod1Params decode(bindings.Decoder decoder0) { | 1219 static PathServiceGetFilesDirResponseParams decode(bindings.Decoder decoder0)
{ |
| 990 if (decoder0 == null) { | 1220 if (decoder0 == null) { |
| 991 return null; | 1221 return null; |
| 992 } | 1222 } |
| 993 SampleInterfaceSampleMethod1Params result = new SampleInterfaceSampleMethod1
Params(); | 1223 PathServiceGetFilesDirResponseParams result = new PathServiceGetFilesDirResp
onseParams(); |
| 994 | 1224 |
| 995 var mainDataHeader = decoder0.decodeStructDataHeader(); | 1225 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 996 if (mainDataHeader.version <= kVersions.last.version) { | 1226 if (mainDataHeader.version <= kVersions.last.version) { |
| 997 // Scan in reverse order to optimize for more recent versions. | 1227 // Scan in reverse order to optimize for more recent versions. |
| 998 for (int i = kVersions.length - 1; i >= 0; --i) { | 1228 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 999 if (mainDataHeader.version >= kVersions[i].version) { | 1229 if (mainDataHeader.version >= kVersions[i].version) { |
| 1000 if (mainDataHeader.size == kVersions[i].size) { | 1230 if (mainDataHeader.size == kVersions[i].size) { |
| 1001 // Found a match. | 1231 // Found a match. |
| 1002 break; | 1232 break; |
| 1003 } | 1233 } |
| 1004 throw new bindings.MojoCodecError( | 1234 throw new bindings.MojoCodecError( |
| 1005 'Header size doesn\'t correspond to known version size.'); | 1235 'Header size doesn\'t correspond to known version size.'); |
| 1006 } | 1236 } |
| 1007 } | 1237 } |
| 1008 } else if (mainDataHeader.size < kVersions.last.size) { | 1238 } else if (mainDataHeader.size < kVersions.last.size) { |
| 1009 throw new bindings.MojoCodecError( | 1239 throw new bindings.MojoCodecError( |
| 1010 'Message newer than the last known version cannot be shorter than ' | 1240 'Message newer than the last known version cannot be shorter than ' |
| 1011 'required by the last known version.'); | 1241 'required by the last known version.'); |
| 1012 } | 1242 } |
| 1013 if (mainDataHeader.version >= 0) { | 1243 if (mainDataHeader.version >= 0) { |
| 1014 | 1244 |
| 1015 result.in1 = decoder0.decodeInt32(8); | 1245 result.path = decoder0.decodeString(8, false); |
| 1016 } | |
| 1017 if (mainDataHeader.version >= 0) { | |
| 1018 | |
| 1019 result.in2 = decoder0.decodeString(16, true); | |
| 1020 } | 1246 } |
| 1021 return result; | 1247 return result; |
| 1022 } | 1248 } |
| 1023 | 1249 |
| 1024 void encode(bindings.Encoder encoder) { | 1250 void encode(bindings.Encoder encoder) { |
| 1025 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 1251 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 1026 | 1252 |
| 1027 encoder0.encodeInt32(in1, 8); | 1253 encoder0.encodeString(path, 8, false); |
| 1028 | |
| 1029 encoder0.encodeString(in2, 16, true); | |
| 1030 } | 1254 } |
| 1031 | 1255 |
| 1032 String toString() { | 1256 String toString() { |
| 1033 return "SampleInterfaceSampleMethod1Params(" | 1257 return "PathServiceGetFilesDirResponseParams(" |
| 1034 "in1: $in1" ", " | 1258 "path: $path" ")"; |
| 1035 "in2: $in2" ")"; | |
| 1036 } | 1259 } |
| 1037 | 1260 |
| 1038 Map toJson() { | 1261 Map toJson() { |
| 1039 Map map = new Map(); | 1262 Map map = new Map(); |
| 1040 map["in1"] = in1; | 1263 map["path"] = path; |
| 1041 map["in2"] = in2; | |
| 1042 return map; | 1264 return map; |
| 1043 } | 1265 } |
| 1044 } | 1266 } |
| 1045 | 1267 |
| 1046 | 1268 |
| 1047 class SampleInterfaceSampleMethod1ResponseParams extends bindings.Struct { | 1269 class PathServiceGetCacheDirParams extends bindings.Struct { |
| 1048 static const List<bindings.StructDataHeader> kVersions = const [ | 1270 static const List<bindings.StructDataHeader> kVersions = const [ |
| 1049 const bindings.StructDataHeader(24, 0) | 1271 const bindings.StructDataHeader(8, 0) |
| 1050 ]; | 1272 ]; |
| 1051 String out1 = null; | |
| 1052 Enum out2 = null; | |
| 1053 | 1273 |
| 1054 SampleInterfaceSampleMethod1ResponseParams() : super(kVersions.last.size); | 1274 PathServiceGetCacheDirParams() : super(kVersions.last.size); |
| 1055 | 1275 |
| 1056 static SampleInterfaceSampleMethod1ResponseParams deserialize(bindings.Message
message) { | 1276 static PathServiceGetCacheDirParams deserialize(bindings.Message message) { |
| 1057 var decoder = new bindings.Decoder(message); | 1277 var decoder = new bindings.Decoder(message); |
| 1058 var result = decode(decoder); | 1278 var result = decode(decoder); |
| 1059 if (decoder.excessHandles != null) { | 1279 if (decoder.excessHandles != null) { |
| 1060 decoder.excessHandles.forEach((h) => h.close()); | 1280 decoder.excessHandles.forEach((h) => h.close()); |
| 1061 } | 1281 } |
| 1062 return result; | 1282 return result; |
| 1063 } | 1283 } |
| 1064 | 1284 |
| 1065 static SampleInterfaceSampleMethod1ResponseParams decode(bindings.Decoder deco
der0) { | 1285 static PathServiceGetCacheDirParams decode(bindings.Decoder decoder0) { |
| 1066 if (decoder0 == null) { | 1286 if (decoder0 == null) { |
| 1067 return null; | 1287 return null; |
| 1068 } | 1288 } |
| 1069 SampleInterfaceSampleMethod1ResponseParams result = new SampleInterfaceSampl
eMethod1ResponseParams(); | 1289 PathServiceGetCacheDirParams result = new PathServiceGetCacheDirParams(); |
| 1070 | 1290 |
| 1071 var mainDataHeader = decoder0.decodeStructDataHeader(); | 1291 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 1072 if (mainDataHeader.version <= kVersions.last.version) { | 1292 if (mainDataHeader.version <= kVersions.last.version) { |
| 1073 // Scan in reverse order to optimize for more recent versions. | 1293 // Scan in reverse order to optimize for more recent versions. |
| 1074 for (int i = kVersions.length - 1; i >= 0; --i) { | 1294 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 1075 if (mainDataHeader.version >= kVersions[i].version) { | 1295 if (mainDataHeader.version >= kVersions[i].version) { |
| 1076 if (mainDataHeader.size == kVersions[i].size) { | 1296 if (mainDataHeader.size == kVersions[i].size) { |
| 1077 // Found a match. | 1297 // Found a match. |
| 1078 break; | 1298 break; |
| 1079 } | 1299 } |
| 1080 throw new bindings.MojoCodecError( | 1300 throw new bindings.MojoCodecError( |
| 1081 'Header size doesn\'t correspond to known version size.'); | 1301 'Header size doesn\'t correspond to known version size.'); |
| 1082 } | 1302 } |
| 1083 } | 1303 } |
| 1084 } else if (mainDataHeader.size < kVersions.last.size) { | 1304 } else if (mainDataHeader.size < kVersions.last.size) { |
| 1085 throw new bindings.MojoCodecError( | 1305 throw new bindings.MojoCodecError( |
| 1086 'Message newer than the last known version cannot be shorter than ' | 1306 'Message newer than the last known version cannot be shorter than ' |
| 1087 'required by the last known version.'); | 1307 'required by the last known version.'); |
| 1088 } | 1308 } |
| 1309 return result; |
| 1310 } |
| 1311 |
| 1312 void encode(bindings.Encoder encoder) { |
| 1313 encoder.getStructEncoderAtOffset(kVersions.last); |
| 1314 } |
| 1315 |
| 1316 String toString() { |
| 1317 return "PathServiceGetCacheDirParams("")"; |
| 1318 } |
| 1319 |
| 1320 Map toJson() { |
| 1321 Map map = new Map(); |
| 1322 return map; |
| 1323 } |
| 1324 } |
| 1325 |
| 1326 |
| 1327 class PathServiceGetCacheDirResponseParams extends bindings.Struct { |
| 1328 static const List<bindings.StructDataHeader> kVersions = const [ |
| 1329 const bindings.StructDataHeader(16, 0) |
| 1330 ]; |
| 1331 String path = null; |
| 1332 |
| 1333 PathServiceGetCacheDirResponseParams() : super(kVersions.last.size); |
| 1334 |
| 1335 static PathServiceGetCacheDirResponseParams deserialize(bindings.Message messa
ge) { |
| 1336 var decoder = new bindings.Decoder(message); |
| 1337 var result = decode(decoder); |
| 1338 if (decoder.excessHandles != null) { |
| 1339 decoder.excessHandles.forEach((h) => h.close()); |
| 1340 } |
| 1341 return result; |
| 1342 } |
| 1343 |
| 1344 static PathServiceGetCacheDirResponseParams decode(bindings.Decoder decoder0)
{ |
| 1345 if (decoder0 == null) { |
| 1346 return null; |
| 1347 } |
| 1348 PathServiceGetCacheDirResponseParams result = new PathServiceGetCacheDirResp
onseParams(); |
| 1349 |
| 1350 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 1351 if (mainDataHeader.version <= kVersions.last.version) { |
| 1352 // Scan in reverse order to optimize for more recent versions. |
| 1353 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 1354 if (mainDataHeader.version >= kVersions[i].version) { |
| 1355 if (mainDataHeader.size == kVersions[i].size) { |
| 1356 // Found a match. |
| 1357 break; |
| 1358 } |
| 1359 throw new bindings.MojoCodecError( |
| 1360 'Header size doesn\'t correspond to known version size.'); |
| 1361 } |
| 1362 } |
| 1363 } else if (mainDataHeader.size < kVersions.last.size) { |
| 1364 throw new bindings.MojoCodecError( |
| 1365 'Message newer than the last known version cannot be shorter than ' |
| 1366 'required by the last known version.'); |
| 1367 } |
| 1089 if (mainDataHeader.version >= 0) { | 1368 if (mainDataHeader.version >= 0) { |
| 1090 | 1369 |
| 1091 result.out1 = decoder0.decodeString(8, true); | 1370 result.path = decoder0.decodeString(8, false); |
| 1092 } | |
| 1093 if (mainDataHeader.version >= 0) { | |
| 1094 | |
| 1095 result.out2 = Enum.decode(decoder0, 16); | |
| 1096 if (result.out2 == null) { | |
| 1097 throw new bindings.MojoCodecError( | |
| 1098 'Trying to decode null union for non-nullable Enum.'); | |
| 1099 } | |
| 1100 } | 1371 } |
| 1101 return result; | 1372 return result; |
| 1102 } | 1373 } |
| 1103 | 1374 |
| 1104 void encode(bindings.Encoder encoder) { | 1375 void encode(bindings.Encoder encoder) { |
| 1105 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | 1376 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 1106 | 1377 |
| 1107 encoder0.encodeString(out1, 8, true); | 1378 encoder0.encodeString(path, 8, false); |
| 1108 | |
| 1109 encoder0.encodeEnum(out2, 16); | |
| 1110 } | 1379 } |
| 1111 | 1380 |
| 1112 String toString() { | 1381 String toString() { |
| 1113 return "SampleInterfaceSampleMethod1ResponseParams(" | 1382 return "PathServiceGetCacheDirResponseParams(" |
| 1114 "out1: $out1" ", " | 1383 "path: $path" ")"; |
| 1115 "out2: $out2" ")"; | |
| 1116 } | 1384 } |
| 1117 | 1385 |
| 1118 Map toJson() { | 1386 Map toJson() { |
| 1119 Map map = new Map(); | 1387 Map map = new Map(); |
| 1120 map["out1"] = out1; | 1388 map["path"] = path; |
| 1121 map["out2"] = out2; | |
| 1122 return map; | 1389 return map; |
| 1123 } | 1390 } |
| 1124 } | 1391 } |
| 1125 | 1392 |
| 1126 | 1393 |
| 1127 class SampleInterfaceSampleMethod0Params extends bindings.Struct { | 1394 class UserFeedbackPerformHapticFeedbackParams extends bindings.Struct { |
| 1128 static const List<bindings.StructDataHeader> kVersions = const [ | 1395 static const List<bindings.StructDataHeader> kVersions = const [ |
| 1129 const bindings.StructDataHeader(8, 0) | 1396 const bindings.StructDataHeader(16, 0) |
| 1130 ]; | 1397 ]; |
| 1398 HapticFeedbackType type = null; |
| 1131 | 1399 |
| 1132 SampleInterfaceSampleMethod0Params() : super(kVersions.last.size); | 1400 UserFeedbackPerformHapticFeedbackParams() : super(kVersions.last.size); |
| 1133 | 1401 |
| 1134 static SampleInterfaceSampleMethod0Params deserialize(bindings.Message message
) { | 1402 static UserFeedbackPerformHapticFeedbackParams deserialize(bindings.Message me
ssage) { |
| 1135 var decoder = new bindings.Decoder(message); | 1403 var decoder = new bindings.Decoder(message); |
| 1136 var result = decode(decoder); | 1404 var result = decode(decoder); |
| 1137 if (decoder.excessHandles != null) { | 1405 if (decoder.excessHandles != null) { |
| 1138 decoder.excessHandles.forEach((h) => h.close()); | 1406 decoder.excessHandles.forEach((h) => h.close()); |
| 1139 } | 1407 } |
| 1140 return result; | 1408 return result; |
| 1141 } | 1409 } |
| 1142 | 1410 |
| 1143 static SampleInterfaceSampleMethod0Params decode(bindings.Decoder decoder0) { | 1411 static UserFeedbackPerformHapticFeedbackParams decode(bindings.Decoder decoder
0) { |
| 1144 if (decoder0 == null) { | 1412 if (decoder0 == null) { |
| 1145 return null; | 1413 return null; |
| 1146 } | 1414 } |
| 1147 SampleInterfaceSampleMethod0Params result = new SampleInterfaceSampleMethod0
Params(); | 1415 UserFeedbackPerformHapticFeedbackParams result = new UserFeedbackPerformHapt
icFeedbackParams(); |
| 1148 | 1416 |
| 1149 var mainDataHeader = decoder0.decodeStructDataHeader(); | 1417 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 1150 if (mainDataHeader.version <= kVersions.last.version) { | 1418 if (mainDataHeader.version <= kVersions.last.version) { |
| 1151 // Scan in reverse order to optimize for more recent versions. | 1419 // Scan in reverse order to optimize for more recent versions. |
| 1152 for (int i = kVersions.length - 1; i >= 0; --i) { | 1420 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 1153 if (mainDataHeader.version >= kVersions[i].version) { | 1421 if (mainDataHeader.version >= kVersions[i].version) { |
| 1154 if (mainDataHeader.size == kVersions[i].size) { | 1422 if (mainDataHeader.size == kVersions[i].size) { |
| 1155 // Found a match. | 1423 // Found a match. |
| 1156 break; | 1424 break; |
| 1157 } | 1425 } |
| 1158 throw new bindings.MojoCodecError( | 1426 throw new bindings.MojoCodecError( |
| 1159 'Header size doesn\'t correspond to known version size.'); | 1427 'Header size doesn\'t correspond to known version size.'); |
| 1160 } | 1428 } |
| 1161 } | 1429 } |
| 1162 } else if (mainDataHeader.size < kVersions.last.size) { | 1430 } else if (mainDataHeader.size < kVersions.last.size) { |
| 1163 throw new bindings.MojoCodecError( | 1431 throw new bindings.MojoCodecError( |
| 1164 'Message newer than the last known version cannot be shorter than ' | 1432 'Message newer than the last known version cannot be shorter than ' |
| 1165 'required by the last known version.'); | 1433 'required by the last known version.'); |
| 1166 } | 1434 } |
| 1435 if (mainDataHeader.version >= 0) { |
| 1436 |
| 1437 result.type = HapticFeedbackType.decode(decoder0, 8); |
| 1438 if (result.type == null) { |
| 1439 throw new bindings.MojoCodecError( |
| 1440 'Trying to decode null union for non-nullable HapticFeedbackType.'); |
| 1441 } |
| 1442 } |
| 1167 return result; | 1443 return result; |
| 1168 } | 1444 } |
| 1169 | 1445 |
| 1170 void encode(bindings.Encoder encoder) { | 1446 void encode(bindings.Encoder encoder) { |
| 1171 encoder.getStructEncoderAtOffset(kVersions.last); | 1447 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 1448 |
| 1449 encoder0.encodeEnum(type, 8); |
| 1172 } | 1450 } |
| 1173 | 1451 |
| 1174 String toString() { | 1452 String toString() { |
| 1175 return "SampleInterfaceSampleMethod0Params("")"; | 1453 return "UserFeedbackPerformHapticFeedbackParams(" |
| 1454 "type: $type" ")"; |
| 1176 } | 1455 } |
| 1177 | 1456 |
| 1178 Map toJson() { | 1457 Map toJson() { |
| 1179 Map map = new Map(); | 1458 Map map = new Map(); |
| 1459 map["type"] = type; |
| 1180 return map; | 1460 return map; |
| 1181 } | 1461 } |
| 1182 } | 1462 } |
| 1183 | 1463 |
| 1184 | 1464 |
| 1185 class SampleInterfaceSampleMethod2Params extends bindings.Struct { | 1465 class UserFeedbackPerformAuralFeedbackParams extends bindings.Struct { |
| 1186 static const List<bindings.StructDataHeader> kVersions = const [ | 1466 static const List<bindings.StructDataHeader> kVersions = const [ |
| 1187 const bindings.StructDataHeader(8, 0) | 1467 const bindings.StructDataHeader(16, 0) |
| 1188 ]; | 1468 ]; |
| 1469 AuralFeedbackType type = null; |
| 1189 | 1470 |
| 1190 SampleInterfaceSampleMethod2Params() : super(kVersions.last.size); | 1471 UserFeedbackPerformAuralFeedbackParams() : super(kVersions.last.size); |
| 1191 | 1472 |
| 1192 static SampleInterfaceSampleMethod2Params deserialize(bindings.Message message
) { | 1473 static UserFeedbackPerformAuralFeedbackParams deserialize(bindings.Message mes
sage) { |
| 1193 var decoder = new bindings.Decoder(message); | 1474 var decoder = new bindings.Decoder(message); |
| 1194 var result = decode(decoder); | 1475 var result = decode(decoder); |
| 1195 if (decoder.excessHandles != null) { | 1476 if (decoder.excessHandles != null) { |
| 1196 decoder.excessHandles.forEach((h) => h.close()); | 1477 decoder.excessHandles.forEach((h) => h.close()); |
| 1197 } | 1478 } |
| 1198 return result; | 1479 return result; |
| 1199 } | 1480 } |
| 1200 | 1481 |
| 1201 static SampleInterfaceSampleMethod2Params decode(bindings.Decoder decoder0) { | 1482 static UserFeedbackPerformAuralFeedbackParams decode(bindings.Decoder decoder0
) { |
| 1202 if (decoder0 == null) { | 1483 if (decoder0 == null) { |
| 1203 return null; | 1484 return null; |
| 1204 } | 1485 } |
| 1205 SampleInterfaceSampleMethod2Params result = new SampleInterfaceSampleMethod2
Params(); | 1486 UserFeedbackPerformAuralFeedbackParams result = new UserFeedbackPerformAural
FeedbackParams(); |
| 1206 | 1487 |
| 1207 var mainDataHeader = decoder0.decodeStructDataHeader(); | 1488 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 1208 if (mainDataHeader.version <= kVersions.last.version) { | 1489 if (mainDataHeader.version <= kVersions.last.version) { |
| 1209 // Scan in reverse order to optimize for more recent versions. | 1490 // Scan in reverse order to optimize for more recent versions. |
| 1210 for (int i = kVersions.length - 1; i >= 0; --i) { | 1491 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 1211 if (mainDataHeader.version >= kVersions[i].version) { | 1492 if (mainDataHeader.version >= kVersions[i].version) { |
| 1212 if (mainDataHeader.size == kVersions[i].size) { | 1493 if (mainDataHeader.size == kVersions[i].size) { |
| 1213 // Found a match. | 1494 // Found a match. |
| 1214 break; | 1495 break; |
| 1215 } | 1496 } |
| 1216 throw new bindings.MojoCodecError( | 1497 throw new bindings.MojoCodecError( |
| 1217 'Header size doesn\'t correspond to known version size.'); | 1498 'Header size doesn\'t correspond to known version size.'); |
| 1218 } | 1499 } |
| 1219 } | 1500 } |
| 1220 } else if (mainDataHeader.size < kVersions.last.size) { | 1501 } else if (mainDataHeader.size < kVersions.last.size) { |
| 1221 throw new bindings.MojoCodecError( | 1502 throw new bindings.MojoCodecError( |
| 1222 'Message newer than the last known version cannot be shorter than ' | 1503 'Message newer than the last known version cannot be shorter than ' |
| 1223 'required by the last known version.'); | 1504 'required by the last known version.'); |
| 1224 } | 1505 } |
| 1506 if (mainDataHeader.version >= 0) { |
| 1507 |
| 1508 result.type = AuralFeedbackType.decode(decoder0, 8); |
| 1509 if (result.type == null) { |
| 1510 throw new bindings.MojoCodecError( |
| 1511 'Trying to decode null union for non-nullable AuralFeedbackType.'); |
| 1512 } |
| 1513 } |
| 1225 return result; | 1514 return result; |
| 1226 } | 1515 } |
| 1227 | 1516 |
| 1228 void encode(bindings.Encoder encoder) { | 1517 void encode(bindings.Encoder encoder) { |
| 1229 encoder.getStructEncoderAtOffset(kVersions.last); | 1518 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 1519 |
| 1520 encoder0.encodeEnum(type, 8); |
| 1230 } | 1521 } |
| 1231 | 1522 |
| 1232 String toString() { | 1523 String toString() { |
| 1233 return "SampleInterfaceSampleMethod2Params("")"; | 1524 return "UserFeedbackPerformAuralFeedbackParams(" |
| 1525 "type: $type" ")"; |
| 1234 } | 1526 } |
| 1235 | 1527 |
| 1236 Map toJson() { | 1528 Map toJson() { |
| 1237 Map map = new Map(); | 1529 Map map = new Map(); |
| 1530 map["type"] = type; |
| 1238 return map; | 1531 return map; |
| 1239 } | 1532 } |
| 1240 } | 1533 } |
| 1241 | 1534 |
| 1242 const int kProvider_echoString_name = 0; | 1535 const int kActivity_getUserFeedback_name = 0; |
| 1243 const int kProvider_echoStrings_name = 1; | 1536 const int kActivity_startActivity_name = 1; |
| 1244 const int kProvider_echoMessagePipeHandle_name = 2; | 1537 const int kActivity_finishCurrentActivity_name = 2; |
| 1245 const int kProvider_echoEnum_name = 3; | 1538 const int kActivity_setTaskDescription_name = 3; |
| 1246 const int kProvider_echoInt_name = 4; | 1539 const int kActivity_setSystemUiVisibility_name = 4; |
| 1540 const int kActivity_setRequestedOrientation_name = 5; |
| 1247 | 1541 |
| 1248 const String ProviderName = | 1542 const String ActivityName = |
| 1249 'sample::Provider'; | 1543 'activity::Activity'; |
| 1250 | 1544 |
| 1251 abstract class Provider { | 1545 abstract class Activity { |
| 1252 dynamic echoString(String a,[Function responseFactory = null]); | 1546 void getUserFeedback(Object userFeedback); |
| 1253 dynamic echoStrings(String a,String b,[Function responseFactory = null]); | 1547 void startActivity(Intent intent); |
| 1254 dynamic echoMessagePipeHandle(core.MojoMessagePipeEndpoint a,[Function respons
eFactory = null]); | 1548 void finishCurrentActivity(); |
| 1255 dynamic echoEnum(Enum a,[Function responseFactory = null]); | 1549 void setTaskDescription(TaskDescription description); |
| 1256 dynamic echoInt(int a,[Function responseFactory = null]); | 1550 void setSystemUiVisibility(SystemUiVisibility visibility); |
| 1551 void setRequestedOrientation(ScreenOrientation orientation); |
| 1257 | 1552 |
| 1258 } | 1553 } |
| 1259 | 1554 |
| 1260 | 1555 |
| 1261 class ProviderProxyImpl extends bindings.Proxy { | 1556 class ActivityProxyImpl extends bindings.Proxy { |
| 1262 ProviderProxyImpl.fromEndpoint( | 1557 ActivityProxyImpl.fromEndpoint( |
| 1263 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1558 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 1264 | 1559 |
| 1265 ProviderProxyImpl.fromHandle(core.MojoHandle handle) : | 1560 ActivityProxyImpl.fromHandle(core.MojoHandle handle) : |
| 1266 super.fromHandle(handle); | 1561 super.fromHandle(handle); |
| 1267 | 1562 |
| 1268 ProviderProxyImpl.unbound() : super.unbound(); | 1563 ActivityProxyImpl.unbound() : super.unbound(); |
| 1269 | 1564 |
| 1270 static ProviderProxyImpl newFromEndpoint( | 1565 static ActivityProxyImpl newFromEndpoint( |
| 1271 core.MojoMessagePipeEndpoint endpoint) { | 1566 core.MojoMessagePipeEndpoint endpoint) { |
| 1272 assert(endpoint.setDescription("For ProviderProxyImpl")); | 1567 assert(endpoint.setDescription("For ActivityProxyImpl")); |
| 1273 return new ProviderProxyImpl.fromEndpoint(endpoint); | 1568 return new ActivityProxyImpl.fromEndpoint(endpoint); |
| 1274 } | 1569 } |
| 1275 | 1570 |
| 1276 String get name => ProviderName; | 1571 String get name => ActivityName; |
| 1277 | 1572 |
| 1278 void handleResponse(bindings.ServiceMessage message) { | 1573 void handleResponse(bindings.ServiceMessage message) { |
| 1279 switch (message.header.type) { | 1574 switch (message.header.type) { |
| 1280 case kProvider_echoString_name: | |
| 1281 var r = ProviderEchoStringResponseParams.deserialize( | |
| 1282 message.payload); | |
| 1283 if (!message.header.hasRequestId) { | |
| 1284 proxyError("Expected a message with a valid request Id."); | |
| 1285 return; | |
| 1286 } | |
| 1287 Completer c = completerMap[message.header.requestId]; | |
| 1288 if (c == null) { | |
| 1289 proxyError( | |
| 1290 "Message had unknown request Id: ${message.header.requestId}"); | |
| 1291 return; | |
| 1292 } | |
| 1293 completerMap.remove(message.header.requestId); | |
| 1294 if (c.isCompleted) { | |
| 1295 proxyError("Response completer already completed"); | |
| 1296 return; | |
| 1297 } | |
| 1298 c.complete(r); | |
| 1299 break; | |
| 1300 case kProvider_echoStrings_name: | |
| 1301 var r = ProviderEchoStringsResponseParams.deserialize( | |
| 1302 message.payload); | |
| 1303 if (!message.header.hasRequestId) { | |
| 1304 proxyError("Expected a message with a valid request Id."); | |
| 1305 return; | |
| 1306 } | |
| 1307 Completer c = completerMap[message.header.requestId]; | |
| 1308 if (c == null) { | |
| 1309 proxyError( | |
| 1310 "Message had unknown request Id: ${message.header.requestId}"); | |
| 1311 return; | |
| 1312 } | |
| 1313 completerMap.remove(message.header.requestId); | |
| 1314 if (c.isCompleted) { | |
| 1315 proxyError("Response completer already completed"); | |
| 1316 return; | |
| 1317 } | |
| 1318 c.complete(r); | |
| 1319 break; | |
| 1320 case kProvider_echoMessagePipeHandle_name: | |
| 1321 var r = ProviderEchoMessagePipeHandleResponseParams.deserialize( | |
| 1322 message.payload); | |
| 1323 if (!message.header.hasRequestId) { | |
| 1324 proxyError("Expected a message with a valid request Id."); | |
| 1325 return; | |
| 1326 } | |
| 1327 Completer c = completerMap[message.header.requestId]; | |
| 1328 if (c == null) { | |
| 1329 proxyError( | |
| 1330 "Message had unknown request Id: ${message.header.requestId}"); | |
| 1331 return; | |
| 1332 } | |
| 1333 completerMap.remove(message.header.requestId); | |
| 1334 if (c.isCompleted) { | |
| 1335 proxyError("Response completer already completed"); | |
| 1336 return; | |
| 1337 } | |
| 1338 c.complete(r); | |
| 1339 break; | |
| 1340 case kProvider_echoEnum_name: | |
| 1341 var r = ProviderEchoEnumResponseParams.deserialize( | |
| 1342 message.payload); | |
| 1343 if (!message.header.hasRequestId) { | |
| 1344 proxyError("Expected a message with a valid request Id."); | |
| 1345 return; | |
| 1346 } | |
| 1347 Completer c = completerMap[message.header.requestId]; | |
| 1348 if (c == null) { | |
| 1349 proxyError( | |
| 1350 "Message had unknown request Id: ${message.header.requestId}"); | |
| 1351 return; | |
| 1352 } | |
| 1353 completerMap.remove(message.header.requestId); | |
| 1354 if (c.isCompleted) { | |
| 1355 proxyError("Response completer already completed"); | |
| 1356 return; | |
| 1357 } | |
| 1358 c.complete(r); | |
| 1359 break; | |
| 1360 case kProvider_echoInt_name: | |
| 1361 var r = ProviderEchoIntResponseParams.deserialize( | |
| 1362 message.payload); | |
| 1363 if (!message.header.hasRequestId) { | |
| 1364 proxyError("Expected a message with a valid request Id."); | |
| 1365 return; | |
| 1366 } | |
| 1367 Completer c = completerMap[message.header.requestId]; | |
| 1368 if (c == null) { | |
| 1369 proxyError( | |
| 1370 "Message had unknown request Id: ${message.header.requestId}"); | |
| 1371 return; | |
| 1372 } | |
| 1373 completerMap.remove(message.header.requestId); | |
| 1374 if (c.isCompleted) { | |
| 1375 proxyError("Response completer already completed"); | |
| 1376 return; | |
| 1377 } | |
| 1378 c.complete(r); | |
| 1379 break; | |
| 1380 default: | 1575 default: |
| 1381 proxyError("Unexpected message type: ${message.header.type}"); | 1576 proxyError("Unexpected message type: ${message.header.type}"); |
| 1382 close(immediate: true); | 1577 close(immediate: true); |
| 1383 break; | 1578 break; |
| 1384 } | 1579 } |
| 1385 } | 1580 } |
| 1386 | 1581 |
| 1387 String toString() { | 1582 String toString() { |
| 1388 var superString = super.toString(); | 1583 var superString = super.toString(); |
| 1389 return "ProviderProxyImpl($superString)"; | 1584 return "ActivityProxyImpl($superString)"; |
| 1390 } | 1585 } |
| 1391 } | 1586 } |
| 1392 | 1587 |
| 1393 | 1588 |
| 1394 class _ProviderProxyCalls implements Provider { | 1589 class _ActivityProxyCalls implements Activity { |
| 1395 ProviderProxyImpl _proxyImpl; | 1590 ActivityProxyImpl _proxyImpl; |
| 1396 | 1591 |
| 1397 _ProviderProxyCalls(this._proxyImpl); | 1592 _ActivityProxyCalls(this._proxyImpl); |
| 1398 dynamic echoString(String a,[Function responseFactory = null]) { | 1593 void getUserFeedback(Object userFeedback) { |
| 1399 var params = new ProviderEchoStringParams(); | 1594 if (!_proxyImpl.isBound) { |
| 1400 params.a = a; | 1595 _proxyImpl.proxyError("The Proxy is closed."); |
| 1401 return _proxyImpl.sendMessageWithRequestId( | 1596 return; |
| 1402 params, | 1597 } |
| 1403 kProvider_echoString_name, | 1598 var params = new ActivityGetUserFeedbackParams(); |
| 1404 -1, | 1599 params.userFeedback = userFeedback; |
| 1405 bindings.MessageHeader.kMessageExpectsResponse); | 1600 _proxyImpl.sendMessage(params, kActivity_getUserFeedback_name); |
| 1406 } | 1601 } |
| 1407 dynamic echoStrings(String a,String b,[Function responseFactory = null]) { | 1602 |
| 1408 var params = new ProviderEchoStringsParams(); | 1603 void startActivity(Intent intent) { |
| 1409 params.a = a; | 1604 if (!_proxyImpl.isBound) { |
| 1410 params.b = b; | 1605 _proxyImpl.proxyError("The Proxy is closed."); |
| 1411 return _proxyImpl.sendMessageWithRequestId( | 1606 return; |
| 1412 params, | 1607 } |
| 1413 kProvider_echoStrings_name, | 1608 var params = new ActivityStartActivityParams(); |
| 1414 -1, | 1609 params.intent = intent; |
| 1415 bindings.MessageHeader.kMessageExpectsResponse); | 1610 _proxyImpl.sendMessage(params, kActivity_startActivity_name); |
| 1416 } | 1611 } |
| 1417 dynamic echoMessagePipeHandle(core.MojoMessagePipeEndpoint a,[Function respo
nseFactory = null]) { | 1612 |
| 1418 var params = new ProviderEchoMessagePipeHandleParams(); | 1613 void finishCurrentActivity() { |
| 1419 params.a = a; | 1614 if (!_proxyImpl.isBound) { |
| 1420 return _proxyImpl.sendMessageWithRequestId( | 1615 _proxyImpl.proxyError("The Proxy is closed."); |
| 1421 params, | 1616 return; |
| 1422 kProvider_echoMessagePipeHandle_name, | 1617 } |
| 1423 -1, | 1618 var params = new ActivityFinishCurrentActivityParams(); |
| 1424 bindings.MessageHeader.kMessageExpectsResponse); | 1619 _proxyImpl.sendMessage(params, kActivity_finishCurrentActivity_name); |
| 1425 } | 1620 } |
| 1426 dynamic echoEnum(Enum a,[Function responseFactory = null]) { | 1621 |
| 1427 var params = new ProviderEchoEnumParams(); | 1622 void setTaskDescription(TaskDescription description) { |
| 1428 params.a = a; | 1623 if (!_proxyImpl.isBound) { |
| 1429 return _proxyImpl.sendMessageWithRequestId( | 1624 _proxyImpl.proxyError("The Proxy is closed."); |
| 1430 params, | 1625 return; |
| 1431 kProvider_echoEnum_name, | 1626 } |
| 1432 -1, | 1627 var params = new ActivitySetTaskDescriptionParams(); |
| 1433 bindings.MessageHeader.kMessageExpectsResponse); | 1628 params.description = description; |
| 1629 _proxyImpl.sendMessage(params, kActivity_setTaskDescription_name); |
| 1434 } | 1630 } |
| 1435 dynamic echoInt(int a,[Function responseFactory = null]) { | 1631 |
| 1436 var params = new ProviderEchoIntParams(); | 1632 void setSystemUiVisibility(SystemUiVisibility visibility) { |
| 1437 params.a = a; | 1633 if (!_proxyImpl.isBound) { |
| 1438 return _proxyImpl.sendMessageWithRequestId( | 1634 _proxyImpl.proxyError("The Proxy is closed."); |
| 1439 params, | 1635 return; |
| 1440 kProvider_echoInt_name, | 1636 } |
| 1441 -1, | 1637 var params = new ActivitySetSystemUiVisibilityParams(); |
| 1442 bindings.MessageHeader.kMessageExpectsResponse); | 1638 params.visibility = visibility; |
| 1639 _proxyImpl.sendMessage(params, kActivity_setSystemUiVisibility_name); |
| 1443 } | 1640 } |
| 1641 |
| 1642 void setRequestedOrientation(ScreenOrientation orientation) { |
| 1643 if (!_proxyImpl.isBound) { |
| 1644 _proxyImpl.proxyError("The Proxy is closed."); |
| 1645 return; |
| 1646 } |
| 1647 var params = new ActivitySetRequestedOrientationParams(); |
| 1648 params.orientation = orientation; |
| 1649 _proxyImpl.sendMessage(params, kActivity_setRequestedOrientation_name); |
| 1650 } |
| 1651 |
| 1444 } | 1652 } |
| 1445 | 1653 |
| 1446 | 1654 |
| 1447 class ProviderProxy implements bindings.ProxyBase { | 1655 class ActivityProxy implements bindings.ProxyBase { |
| 1448 final bindings.Proxy impl; | 1656 final bindings.Proxy impl; |
| 1449 Provider ptr; | 1657 Activity ptr; |
| 1450 final String name = ProviderName; | 1658 final String name = ActivityName; |
| 1451 | 1659 |
| 1452 ProviderProxy(ProviderProxyImpl proxyImpl) : | 1660 ActivityProxy(ActivityProxyImpl proxyImpl) : |
| 1453 impl = proxyImpl, | 1661 impl = proxyImpl, |
| 1454 ptr = new _ProviderProxyCalls(proxyImpl); | 1662 ptr = new _ActivityProxyCalls(proxyImpl); |
| 1455 | 1663 |
| 1456 ProviderProxy.fromEndpoint( | 1664 ActivityProxy.fromEndpoint( |
| 1457 core.MojoMessagePipeEndpoint endpoint) : | 1665 core.MojoMessagePipeEndpoint endpoint) : |
| 1458 impl = new ProviderProxyImpl.fromEndpoint(endpoint) { | 1666 impl = new ActivityProxyImpl.fromEndpoint(endpoint) { |
| 1459 ptr = new _ProviderProxyCalls(impl); | 1667 ptr = new _ActivityProxyCalls(impl); |
| 1460 } | 1668 } |
| 1461 | 1669 |
| 1462 ProviderProxy.fromHandle(core.MojoHandle handle) : | 1670 ActivityProxy.fromHandle(core.MojoHandle handle) : |
| 1463 impl = new ProviderProxyImpl.fromHandle(handle) { | 1671 impl = new ActivityProxyImpl.fromHandle(handle) { |
| 1464 ptr = new _ProviderProxyCalls(impl); | 1672 ptr = new _ActivityProxyCalls(impl); |
| 1465 } | 1673 } |
| 1466 | 1674 |
| 1467 ProviderProxy.unbound() : | 1675 ActivityProxy.unbound() : |
| 1468 impl = new ProviderProxyImpl.unbound() { | 1676 impl = new ActivityProxyImpl.unbound() { |
| 1469 ptr = new _ProviderProxyCalls(impl); | 1677 ptr = new _ActivityProxyCalls(impl); |
| 1470 } | 1678 } |
| 1471 | 1679 |
| 1472 factory ProviderProxy.connectToService( | 1680 factory ActivityProxy.connectToService( |
| 1473 bindings.ServiceConnector s, String url) { | 1681 bindings.ServiceConnector s, String url) { |
| 1474 ProviderProxy p = new ProviderProxy.unbound(); | 1682 ActivityProxy p = new ActivityProxy.unbound(); |
| 1475 s.connectToService(url, p); | 1683 s.connectToService(url, p); |
| 1476 return p; | 1684 return p; |
| 1477 } | 1685 } |
| 1478 | 1686 |
| 1479 static ProviderProxy newFromEndpoint( | 1687 static ActivityProxy newFromEndpoint( |
| 1480 core.MojoMessagePipeEndpoint endpoint) { | 1688 core.MojoMessagePipeEndpoint endpoint) { |
| 1481 assert(endpoint.setDescription("For ProviderProxy")); | 1689 assert(endpoint.setDescription("For ActivityProxy")); |
| 1482 return new ProviderProxy.fromEndpoint(endpoint); | 1690 return new ActivityProxy.fromEndpoint(endpoint); |
| 1483 } | 1691 } |
| 1484 | 1692 |
| 1485 Future close({bool immediate: false}) => impl.close(immediate: immediate); | 1693 Future close({bool immediate: false}) => impl.close(immediate: immediate); |
| 1486 | 1694 |
| 1487 Future responseOrError(Future f) => impl.responseOrError(f); | 1695 Future responseOrError(Future f) => impl.responseOrError(f); |
| 1488 | 1696 |
| 1489 Future get errorFuture => impl.errorFuture; | 1697 Future get errorFuture => impl.errorFuture; |
| 1490 | 1698 |
| 1491 int get version => impl.version; | 1699 int get version => impl.version; |
| 1492 | 1700 |
| 1493 Future<int> queryVersion() => impl.queryVersion(); | 1701 Future<int> queryVersion() => impl.queryVersion(); |
| 1494 | 1702 |
| 1495 void requireVersion(int requiredVersion) { | 1703 void requireVersion(int requiredVersion) { |
| 1496 impl.requireVersion(requiredVersion); | 1704 impl.requireVersion(requiredVersion); |
| 1497 } | 1705 } |
| 1498 | 1706 |
| 1499 String toString() { | 1707 String toString() { |
| 1500 return "ProviderProxy($impl)"; | 1708 return "ActivityProxy($impl)"; |
| 1501 } | 1709 } |
| 1502 } | 1710 } |
| 1503 | 1711 |
| 1504 | 1712 |
| 1505 class ProviderStub extends bindings.Stub { | 1713 class ActivityStub extends bindings.Stub { |
| 1506 Provider _impl = null; | 1714 Activity _impl = null; |
| 1507 | 1715 |
| 1508 ProviderStub.fromEndpoint( | 1716 ActivityStub.fromEndpoint( |
| 1509 core.MojoMessagePipeEndpoint endpoint, [this._impl]) | 1717 core.MojoMessagePipeEndpoint endpoint, [this._impl]) |
| 1510 : super.fromEndpoint(endpoint); | 1718 : super.fromEndpoint(endpoint); |
| 1511 | 1719 |
| 1512 ProviderStub.fromHandle(core.MojoHandle handle, [this._impl]) | 1720 ActivityStub.fromHandle(core.MojoHandle handle, [this._impl]) |
| 1513 : super.fromHandle(handle); | 1721 : super.fromHandle(handle); |
| 1514 | 1722 |
| 1515 ProviderStub.unbound() : super.unbound(); | 1723 ActivityStub.unbound() : super.unbound(); |
| 1516 | 1724 |
| 1517 static ProviderStub newFromEndpoint( | 1725 static ActivityStub newFromEndpoint( |
| 1518 core.MojoMessagePipeEndpoint endpoint) { | 1726 core.MojoMessagePipeEndpoint endpoint) { |
| 1519 assert(endpoint.setDescription("For ProviderStub")); | 1727 assert(endpoint.setDescription("For ActivityStub")); |
| 1520 return new ProviderStub.fromEndpoint(endpoint); | 1728 return new ActivityStub.fromEndpoint(endpoint); |
| 1521 } | 1729 } |
| 1522 | 1730 |
| 1523 static const String name = ProviderName; | 1731 static const String name = ActivityName; |
| 1524 | 1732 |
| 1525 | 1733 |
| 1526 ProviderEchoStringResponseParams _ProviderEchoStringResponseParamsFactory(Stri
ng a) { | |
| 1527 var mojo_factory_result = new ProviderEchoStringResponseParams(); | |
| 1528 mojo_factory_result.a = a; | |
| 1529 return mojo_factory_result; | |
| 1530 } | |
| 1531 ProviderEchoStringsResponseParams _ProviderEchoStringsResponseParamsFactory(St
ring a, String b) { | |
| 1532 var mojo_factory_result = new ProviderEchoStringsResponseParams(); | |
| 1533 mojo_factory_result.a = a; | |
| 1534 mojo_factory_result.b = b; | |
| 1535 return mojo_factory_result; | |
| 1536 } | |
| 1537 ProviderEchoMessagePipeHandleResponseParams _ProviderEchoMessagePipeHandleResp
onseParamsFactory(core.MojoMessagePipeEndpoint a) { | |
| 1538 var mojo_factory_result = new ProviderEchoMessagePipeHandleResponseParams(); | |
| 1539 mojo_factory_result.a = a; | |
| 1540 return mojo_factory_result; | |
| 1541 } | |
| 1542 ProviderEchoEnumResponseParams _ProviderEchoEnumResponseParamsFactory(Enum a)
{ | |
| 1543 var mojo_factory_result = new ProviderEchoEnumResponseParams(); | |
| 1544 mojo_factory_result.a = a; | |
| 1545 return mojo_factory_result; | |
| 1546 } | |
| 1547 ProviderEchoIntResponseParams _ProviderEchoIntResponseParamsFactory(int a) { | |
| 1548 var mojo_factory_result = new ProviderEchoIntResponseParams(); | |
| 1549 mojo_factory_result.a = a; | |
| 1550 return mojo_factory_result; | |
| 1551 } | |
| 1552 | 1734 |
| 1553 dynamic handleMessage(bindings.ServiceMessage message) { | 1735 dynamic handleMessage(bindings.ServiceMessage message) { |
| 1554 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1736 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 1555 return bindings.ControlMessageHandler.handleMessage(this, | 1737 return bindings.ControlMessageHandler.handleMessage(this, |
| 1556 0, | 1738 0, |
| 1557 message); | 1739 message); |
| 1558 } | 1740 } |
| 1559 assert(_impl != null); | 1741 assert(_impl != null); |
| 1560 switch (message.header.type) { | 1742 switch (message.header.type) { |
| 1561 case kProvider_echoString_name: | 1743 case kActivity_getUserFeedback_name: |
| 1562 var params = ProviderEchoStringParams.deserialize( | 1744 var params = ActivityGetUserFeedbackParams.deserialize( |
| 1563 message.payload); | 1745 message.payload); |
| 1564 var response = _impl.echoString(params.a,_ProviderEchoStringResponsePara
msFactory); | 1746 _impl.getUserFeedback(params.userFeedback); |
| 1565 if (response is Future) { | |
| 1566 return response.then((response) { | |
| 1567 if (response != null) { | |
| 1568 return buildResponseWithId( | |
| 1569 response, | |
| 1570 kProvider_echoString_name, | |
| 1571 message.header.requestId, | |
| 1572 bindings.MessageHeader.kMessageIsResponse); | |
| 1573 } | |
| 1574 }); | |
| 1575 } else if (response != null) { | |
| 1576 return buildResponseWithId( | |
| 1577 response, | |
| 1578 kProvider_echoString_name, | |
| 1579 message.header.requestId, | |
| 1580 bindings.MessageHeader.kMessageIsResponse); | |
| 1581 } | |
| 1582 break; | 1747 break; |
| 1583 case kProvider_echoStrings_name: | 1748 case kActivity_startActivity_name: |
| 1584 var params = ProviderEchoStringsParams.deserialize( | 1749 var params = ActivityStartActivityParams.deserialize( |
| 1585 message.payload); | 1750 message.payload); |
| 1586 var response = _impl.echoStrings(params.a,params.b,_ProviderEchoStringsR
esponseParamsFactory); | 1751 _impl.startActivity(params.intent); |
| 1587 if (response is Future) { | |
| 1588 return response.then((response) { | |
| 1589 if (response != null) { | |
| 1590 return buildResponseWithId( | |
| 1591 response, | |
| 1592 kProvider_echoStrings_name, | |
| 1593 message.header.requestId, | |
| 1594 bindings.MessageHeader.kMessageIsResponse); | |
| 1595 } | |
| 1596 }); | |
| 1597 } else if (response != null) { | |
| 1598 return buildResponseWithId( | |
| 1599 response, | |
| 1600 kProvider_echoStrings_name, | |
| 1601 message.header.requestId, | |
| 1602 bindings.MessageHeader.kMessageIsResponse); | |
| 1603 } | |
| 1604 break; | 1752 break; |
| 1605 case kProvider_echoMessagePipeHandle_name: | 1753 case kActivity_finishCurrentActivity_name: |
| 1606 var params = ProviderEchoMessagePipeHandleParams.deserialize( | 1754 var params = ActivityFinishCurrentActivityParams.deserialize( |
| 1607 message.payload); | 1755 message.payload); |
| 1608 var response = _impl.echoMessagePipeHandle(params.a,_ProviderEchoMessage
PipeHandleResponseParamsFactory); | 1756 _impl.finishCurrentActivity(); |
| 1609 if (response is Future) { | |
| 1610 return response.then((response) { | |
| 1611 if (response != null) { | |
| 1612 return buildResponseWithId( | |
| 1613 response, | |
| 1614 kProvider_echoMessagePipeHandle_name, | |
| 1615 message.header.requestId, | |
| 1616 bindings.MessageHeader.kMessageIsResponse); | |
| 1617 } | |
| 1618 }); | |
| 1619 } else if (response != null) { | |
| 1620 return buildResponseWithId( | |
| 1621 response, | |
| 1622 kProvider_echoMessagePipeHandle_name, | |
| 1623 message.header.requestId, | |
| 1624 bindings.MessageHeader.kMessageIsResponse); | |
| 1625 } | |
| 1626 break; | 1757 break; |
| 1627 case kProvider_echoEnum_name: | 1758 case kActivity_setTaskDescription_name: |
| 1628 var params = ProviderEchoEnumParams.deserialize( | 1759 var params = ActivitySetTaskDescriptionParams.deserialize( |
| 1629 message.payload); | 1760 message.payload); |
| 1630 var response = _impl.echoEnum(params.a,_ProviderEchoEnumResponseParamsFa
ctory); | 1761 _impl.setTaskDescription(params.description); |
| 1631 if (response is Future) { | |
| 1632 return response.then((response) { | |
| 1633 if (response != null) { | |
| 1634 return buildResponseWithId( | |
| 1635 response, | |
| 1636 kProvider_echoEnum_name, | |
| 1637 message.header.requestId, | |
| 1638 bindings.MessageHeader.kMessageIsResponse); | |
| 1639 } | |
| 1640 }); | |
| 1641 } else if (response != null) { | |
| 1642 return buildResponseWithId( | |
| 1643 response, | |
| 1644 kProvider_echoEnum_name, | |
| 1645 message.header.requestId, | |
| 1646 bindings.MessageHeader.kMessageIsResponse); | |
| 1647 } | |
| 1648 break; | 1762 break; |
| 1649 case kProvider_echoInt_name: | 1763 case kActivity_setSystemUiVisibility_name: |
| 1650 var params = ProviderEchoIntParams.deserialize( | 1764 var params = ActivitySetSystemUiVisibilityParams.deserialize( |
| 1651 message.payload); | 1765 message.payload); |
| 1652 var response = _impl.echoInt(params.a,_ProviderEchoIntResponseParamsFact
ory); | 1766 _impl.setSystemUiVisibility(params.visibility); |
| 1653 if (response is Future) { | 1767 break; |
| 1654 return response.then((response) { | 1768 case kActivity_setRequestedOrientation_name: |
| 1655 if (response != null) { | 1769 var params = ActivitySetRequestedOrientationParams.deserialize( |
| 1656 return buildResponseWithId( | 1770 message.payload); |
| 1657 response, | 1771 _impl.setRequestedOrientation(params.orientation); |
| 1658 kProvider_echoInt_name, | |
| 1659 message.header.requestId, | |
| 1660 bindings.MessageHeader.kMessageIsResponse); | |
| 1661 } | |
| 1662 }); | |
| 1663 } else if (response != null) { | |
| 1664 return buildResponseWithId( | |
| 1665 response, | |
| 1666 kProvider_echoInt_name, | |
| 1667 message.header.requestId, | |
| 1668 bindings.MessageHeader.kMessageIsResponse); | |
| 1669 } | |
| 1670 break; | 1772 break; |
| 1671 default: | 1773 default: |
| 1672 throw new bindings.MojoCodecError("Unexpected message name"); | 1774 throw new bindings.MojoCodecError("Unexpected message name"); |
| 1673 break; | 1775 break; |
| 1674 } | 1776 } |
| 1675 return null; | 1777 return null; |
| 1676 } | 1778 } |
| 1677 | 1779 |
| 1678 Provider get impl => _impl; | 1780 Activity get impl => _impl; |
| 1679 set impl(Provider d) { | 1781 set impl(Activity d) { |
| 1680 assert(_impl == null); | 1782 assert(_impl == null); |
| 1681 _impl = d; | 1783 _impl = d; |
| 1682 } | 1784 } |
| 1683 | 1785 |
| 1684 String toString() { | 1786 String toString() { |
| 1685 var superString = super.toString(); | 1787 var superString = super.toString(); |
| 1686 return "ProviderStub($superString)"; | 1788 return "ActivityStub($superString)"; |
| 1687 } | 1789 } |
| 1688 | 1790 |
| 1689 int get version => 0; | 1791 int get version => 0; |
| 1690 } | 1792 } |
| 1691 | 1793 |
| 1692 const int kIntegerAccessor_getInteger_name = 0; | 1794 const int kPathService_getAppDataDir_name = 0; |
| 1693 const int kIntegerAccessor_setInteger_name = 1; | 1795 const int kPathService_getFilesDir_name = 1; |
| 1796 const int kPathService_getCacheDir_name = 2; |
| 1694 | 1797 |
| 1695 const String IntegerAccessorName = | 1798 const String PathServiceName = |
| 1696 'sample::IntegerAccessor'; | 1799 'activity::PathService'; |
| 1697 | 1800 |
| 1698 abstract class IntegerAccessor { | 1801 abstract class PathService { |
| 1699 dynamic getInteger([Function responseFactory = null]); | 1802 dynamic getAppDataDir([Function responseFactory = null]); |
| 1700 void setInteger(int data, Enum type); | 1803 dynamic getFilesDir([Function responseFactory = null]); |
| 1804 dynamic getCacheDir([Function responseFactory = null]); |
| 1701 | 1805 |
| 1702 } | 1806 } |
| 1703 | 1807 |
| 1704 | 1808 |
| 1705 class IntegerAccessorProxyImpl extends bindings.Proxy { | 1809 class PathServiceProxyImpl extends bindings.Proxy { |
| 1706 IntegerAccessorProxyImpl.fromEndpoint( | 1810 PathServiceProxyImpl.fromEndpoint( |
| 1707 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1811 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 1708 | 1812 |
| 1709 IntegerAccessorProxyImpl.fromHandle(core.MojoHandle handle) : | 1813 PathServiceProxyImpl.fromHandle(core.MojoHandle handle) : |
| 1710 super.fromHandle(handle); | 1814 super.fromHandle(handle); |
| 1711 | 1815 |
| 1712 IntegerAccessorProxyImpl.unbound() : super.unbound(); | 1816 PathServiceProxyImpl.unbound() : super.unbound(); |
| 1713 | 1817 |
| 1714 static IntegerAccessorProxyImpl newFromEndpoint( | 1818 static PathServiceProxyImpl newFromEndpoint( |
| 1715 core.MojoMessagePipeEndpoint endpoint) { | 1819 core.MojoMessagePipeEndpoint endpoint) { |
| 1716 assert(endpoint.setDescription("For IntegerAccessorProxyImpl")); | 1820 assert(endpoint.setDescription("For PathServiceProxyImpl")); |
| 1717 return new IntegerAccessorProxyImpl.fromEndpoint(endpoint); | 1821 return new PathServiceProxyImpl.fromEndpoint(endpoint); |
| 1718 } | 1822 } |
| 1719 | 1823 |
| 1720 String get name => IntegerAccessorName; | 1824 String get name => PathServiceName; |
| 1721 | 1825 |
| 1722 void handleResponse(bindings.ServiceMessage message) { | 1826 void handleResponse(bindings.ServiceMessage message) { |
| 1723 switch (message.header.type) { | 1827 switch (message.header.type) { |
| 1724 case kIntegerAccessor_getInteger_name: | 1828 case kPathService_getAppDataDir_name: |
| 1725 var r = IntegerAccessorGetIntegerResponseParams.deserialize( | 1829 var r = PathServiceGetAppDataDirResponseParams.deserialize( |
| 1726 message.payload); | 1830 message.payload); |
| 1727 if (!message.header.hasRequestId) { | 1831 if (!message.header.hasRequestId) { |
| 1728 proxyError("Expected a message with a valid request Id."); | 1832 proxyError("Expected a message with a valid request Id."); |
| 1833 return; |
| 1834 } |
| 1835 Completer c = completerMap[message.header.requestId]; |
| 1836 if (c == null) { |
| 1837 proxyError( |
| 1838 "Message had unknown request Id: ${message.header.requestId}"); |
| 1839 return; |
| 1840 } |
| 1841 completerMap.remove(message.header.requestId); |
| 1842 if (c.isCompleted) { |
| 1843 proxyError("Response completer already completed"); |
| 1844 return; |
| 1845 } |
| 1846 c.complete(r); |
| 1847 break; |
| 1848 case kPathService_getFilesDir_name: |
| 1849 var r = PathServiceGetFilesDirResponseParams.deserialize( |
| 1850 message.payload); |
| 1851 if (!message.header.hasRequestId) { |
| 1852 proxyError("Expected a message with a valid request Id."); |
| 1853 return; |
| 1854 } |
| 1855 Completer c = completerMap[message.header.requestId]; |
| 1856 if (c == null) { |
| 1857 proxyError( |
| 1858 "Message had unknown request Id: ${message.header.requestId}"); |
| 1859 return; |
| 1860 } |
| 1861 completerMap.remove(message.header.requestId); |
| 1862 if (c.isCompleted) { |
| 1863 proxyError("Response completer already completed"); |
| 1864 return; |
| 1865 } |
| 1866 c.complete(r); |
| 1867 break; |
| 1868 case kPathService_getCacheDir_name: |
| 1869 var r = PathServiceGetCacheDirResponseParams.deserialize( |
| 1870 message.payload); |
| 1871 if (!message.header.hasRequestId) { |
| 1872 proxyError("Expected a message with a valid request Id."); |
| 1729 return; | 1873 return; |
| 1730 } | 1874 } |
| 1731 Completer c = completerMap[message.header.requestId]; | 1875 Completer c = completerMap[message.header.requestId]; |
| 1732 if (c == null) { | 1876 if (c == null) { |
| 1733 proxyError( | 1877 proxyError( |
| 1734 "Message had unknown request Id: ${message.header.requestId}"); | 1878 "Message had unknown request Id: ${message.header.requestId}"); |
| 1735 return; | 1879 return; |
| 1736 } | 1880 } |
| 1737 completerMap.remove(message.header.requestId); | 1881 completerMap.remove(message.header.requestId); |
| 1738 if (c.isCompleted) { | 1882 if (c.isCompleted) { |
| 1739 proxyError("Response completer already completed"); | 1883 proxyError("Response completer already completed"); |
| 1740 return; | 1884 return; |
| 1741 } | 1885 } |
| 1742 c.complete(r); | 1886 c.complete(r); |
| 1743 break; | 1887 break; |
| 1744 default: | 1888 default: |
| 1745 proxyError("Unexpected message type: ${message.header.type}"); | 1889 proxyError("Unexpected message type: ${message.header.type}"); |
| 1746 close(immediate: true); | 1890 close(immediate: true); |
| 1747 break; | 1891 break; |
| 1748 } | 1892 } |
| 1749 } | 1893 } |
| 1750 | 1894 |
| 1751 String toString() { | 1895 String toString() { |
| 1752 var superString = super.toString(); | 1896 var superString = super.toString(); |
| 1753 return "IntegerAccessorProxyImpl($superString)"; | 1897 return "PathServiceProxyImpl($superString)"; |
| 1754 } | 1898 } |
| 1755 } | 1899 } |
| 1756 | 1900 |
| 1757 | 1901 |
| 1758 class _IntegerAccessorProxyCalls implements IntegerAccessor { | 1902 class _PathServiceProxyCalls implements PathService { |
| 1759 IntegerAccessorProxyImpl _proxyImpl; | 1903 PathServiceProxyImpl _proxyImpl; |
| 1760 | 1904 |
| 1761 _IntegerAccessorProxyCalls(this._proxyImpl); | 1905 _PathServiceProxyCalls(this._proxyImpl); |
| 1762 dynamic getInteger([Function responseFactory = null]) { | 1906 dynamic getAppDataDir([Function responseFactory = null]) { |
| 1763 var params = new IntegerAccessorGetIntegerParams(); | 1907 var params = new PathServiceGetAppDataDirParams(); |
| 1764 return _proxyImpl.sendMessageWithRequestId( | 1908 return _proxyImpl.sendMessageWithRequestId( |
| 1765 params, | 1909 params, |
| 1766 kIntegerAccessor_getInteger_name, | 1910 kPathService_getAppDataDir_name, |
| 1767 -1, | 1911 -1, |
| 1768 bindings.MessageHeader.kMessageExpectsResponse); | 1912 bindings.MessageHeader.kMessageExpectsResponse); |
| 1769 } | 1913 } |
| 1770 void setInteger(int data, Enum type) { | 1914 dynamic getFilesDir([Function responseFactory = null]) { |
| 1771 if (!_proxyImpl.isBound) { | 1915 var params = new PathServiceGetFilesDirParams(); |
| 1772 _proxyImpl.proxyError("The Proxy is closed."); | 1916 return _proxyImpl.sendMessageWithRequestId( |
| 1773 return; | 1917 params, |
| 1774 } | 1918 kPathService_getFilesDir_name, |
| 1775 var params = new IntegerAccessorSetIntegerParams(); | 1919 -1, |
| 1776 params.data = data; | 1920 bindings.MessageHeader.kMessageExpectsResponse); |
| 1777 params.type = type; | |
| 1778 _proxyImpl.sendMessage(params, kIntegerAccessor_setInteger_name); | |
| 1779 } | 1921 } |
| 1780 | 1922 dynamic getCacheDir([Function responseFactory = null]) { |
| 1923 var params = new PathServiceGetCacheDirParams(); |
| 1924 return _proxyImpl.sendMessageWithRequestId( |
| 1925 params, |
| 1926 kPathService_getCacheDir_name, |
| 1927 -1, |
| 1928 bindings.MessageHeader.kMessageExpectsResponse); |
| 1929 } |
| 1781 } | 1930 } |
| 1782 | 1931 |
| 1783 | 1932 |
| 1784 class IntegerAccessorProxy implements bindings.ProxyBase { | 1933 class PathServiceProxy implements bindings.ProxyBase { |
| 1785 final bindings.Proxy impl; | 1934 final bindings.Proxy impl; |
| 1786 IntegerAccessor ptr; | 1935 PathService ptr; |
| 1787 final String name = IntegerAccessorName; | 1936 final String name = PathServiceName; |
| 1788 | 1937 |
| 1789 IntegerAccessorProxy(IntegerAccessorProxyImpl proxyImpl) : | 1938 PathServiceProxy(PathServiceProxyImpl proxyImpl) : |
| 1790 impl = proxyImpl, | 1939 impl = proxyImpl, |
| 1791 ptr = new _IntegerAccessorProxyCalls(proxyImpl); | 1940 ptr = new _PathServiceProxyCalls(proxyImpl); |
| 1792 | 1941 |
| 1793 IntegerAccessorProxy.fromEndpoint( | 1942 PathServiceProxy.fromEndpoint( |
| 1794 core.MojoMessagePipeEndpoint endpoint) : | 1943 core.MojoMessagePipeEndpoint endpoint) : |
| 1795 impl = new IntegerAccessorProxyImpl.fromEndpoint(endpoint) { | 1944 impl = new PathServiceProxyImpl.fromEndpoint(endpoint) { |
| 1796 ptr = new _IntegerAccessorProxyCalls(impl); | 1945 ptr = new _PathServiceProxyCalls(impl); |
| 1797 } | 1946 } |
| 1798 | 1947 |
| 1799 IntegerAccessorProxy.fromHandle(core.MojoHandle handle) : | 1948 PathServiceProxy.fromHandle(core.MojoHandle handle) : |
| 1800 impl = new IntegerAccessorProxyImpl.fromHandle(handle) { | 1949 impl = new PathServiceProxyImpl.fromHandle(handle) { |
| 1801 ptr = new _IntegerAccessorProxyCalls(impl); | 1950 ptr = new _PathServiceProxyCalls(impl); |
| 1802 } | 1951 } |
| 1803 | 1952 |
| 1804 IntegerAccessorProxy.unbound() : | 1953 PathServiceProxy.unbound() : |
| 1805 impl = new IntegerAccessorProxyImpl.unbound() { | 1954 impl = new PathServiceProxyImpl.unbound() { |
| 1806 ptr = new _IntegerAccessorProxyCalls(impl); | 1955 ptr = new _PathServiceProxyCalls(impl); |
| 1807 } | 1956 } |
| 1808 | 1957 |
| 1809 factory IntegerAccessorProxy.connectToService( | 1958 factory PathServiceProxy.connectToService( |
| 1810 bindings.ServiceConnector s, String url) { | 1959 bindings.ServiceConnector s, String url) { |
| 1811 IntegerAccessorProxy p = new IntegerAccessorProxy.unbound(); | 1960 PathServiceProxy p = new PathServiceProxy.unbound(); |
| 1812 s.connectToService(url, p); | 1961 s.connectToService(url, p); |
| 1813 return p; | 1962 return p; |
| 1814 } | 1963 } |
| 1815 | 1964 |
| 1816 static IntegerAccessorProxy newFromEndpoint( | 1965 static PathServiceProxy newFromEndpoint( |
| 1817 core.MojoMessagePipeEndpoint endpoint) { | 1966 core.MojoMessagePipeEndpoint endpoint) { |
| 1818 assert(endpoint.setDescription("For IntegerAccessorProxy")); | 1967 assert(endpoint.setDescription("For PathServiceProxy")); |
| 1819 return new IntegerAccessorProxy.fromEndpoint(endpoint); | 1968 return new PathServiceProxy.fromEndpoint(endpoint); |
| 1820 } | 1969 } |
| 1821 | 1970 |
| 1822 Future close({bool immediate: false}) => impl.close(immediate: immediate); | 1971 Future close({bool immediate: false}) => impl.close(immediate: immediate); |
| 1823 | 1972 |
| 1824 Future responseOrError(Future f) => impl.responseOrError(f); | 1973 Future responseOrError(Future f) => impl.responseOrError(f); |
| 1825 | 1974 |
| 1826 Future get errorFuture => impl.errorFuture; | 1975 Future get errorFuture => impl.errorFuture; |
| 1827 | 1976 |
| 1828 int get version => impl.version; | 1977 int get version => impl.version; |
| 1829 | 1978 |
| 1830 Future<int> queryVersion() => impl.queryVersion(); | 1979 Future<int> queryVersion() => impl.queryVersion(); |
| 1831 | 1980 |
| 1832 void requireVersion(int requiredVersion) { | 1981 void requireVersion(int requiredVersion) { |
| 1833 impl.requireVersion(requiredVersion); | 1982 impl.requireVersion(requiredVersion); |
| 1834 } | 1983 } |
| 1835 | 1984 |
| 1836 String toString() { | 1985 String toString() { |
| 1837 return "IntegerAccessorProxy($impl)"; | 1986 return "PathServiceProxy($impl)"; |
| 1838 } | 1987 } |
| 1839 } | 1988 } |
| 1840 | 1989 |
| 1841 | 1990 |
| 1842 class IntegerAccessorStub extends bindings.Stub { | 1991 class PathServiceStub extends bindings.Stub { |
| 1843 IntegerAccessor _impl = null; | 1992 PathService _impl = null; |
| 1844 | 1993 |
| 1845 IntegerAccessorStub.fromEndpoint( | 1994 PathServiceStub.fromEndpoint( |
| 1846 core.MojoMessagePipeEndpoint endpoint, [this._impl]) | 1995 core.MojoMessagePipeEndpoint endpoint, [this._impl]) |
| 1847 : super.fromEndpoint(endpoint); | 1996 : super.fromEndpoint(endpoint); |
| 1848 | 1997 |
| 1849 IntegerAccessorStub.fromHandle(core.MojoHandle handle, [this._impl]) | 1998 PathServiceStub.fromHandle(core.MojoHandle handle, [this._impl]) |
| 1850 : super.fromHandle(handle); | 1999 : super.fromHandle(handle); |
| 1851 | 2000 |
| 1852 IntegerAccessorStub.unbound() : super.unbound(); | 2001 PathServiceStub.unbound() : super.unbound(); |
| 1853 | 2002 |
| 1854 static IntegerAccessorStub newFromEndpoint( | 2003 static PathServiceStub newFromEndpoint( |
| 1855 core.MojoMessagePipeEndpoint endpoint) { | 2004 core.MojoMessagePipeEndpoint endpoint) { |
| 1856 assert(endpoint.setDescription("For IntegerAccessorStub")); | 2005 assert(endpoint.setDescription("For PathServiceStub")); |
| 1857 return new IntegerAccessorStub.fromEndpoint(endpoint); | 2006 return new PathServiceStub.fromEndpoint(endpoint); |
| 1858 } | 2007 } |
| 1859 | 2008 |
| 1860 static const String name = IntegerAccessorName; | 2009 static const String name = PathServiceName; |
| 1861 | 2010 |
| 1862 | 2011 |
| 1863 IntegerAccessorGetIntegerResponseParams _IntegerAccessorGetIntegerResponsePara
msFactory(int data, Enum type) { | 2012 PathServiceGetAppDataDirResponseParams _PathServiceGetAppDataDirResponseParams
Factory(String path) { |
| 1864 var mojo_factory_result = new IntegerAccessorGetIntegerResponseParams(); | 2013 var mojo_factory_result = new PathServiceGetAppDataDirResponseParams(); |
| 1865 mojo_factory_result.data = data; | 2014 mojo_factory_result.path = path; |
| 1866 mojo_factory_result.type = type; | 2015 return mojo_factory_result; |
| 2016 } |
| 2017 PathServiceGetFilesDirResponseParams _PathServiceGetFilesDirResponseParamsFact
ory(String path) { |
| 2018 var mojo_factory_result = new PathServiceGetFilesDirResponseParams(); |
| 2019 mojo_factory_result.path = path; |
| 2020 return mojo_factory_result; |
| 2021 } |
| 2022 PathServiceGetCacheDirResponseParams _PathServiceGetCacheDirResponseParamsFact
ory(String path) { |
| 2023 var mojo_factory_result = new PathServiceGetCacheDirResponseParams(); |
| 2024 mojo_factory_result.path = path; |
| 1867 return mojo_factory_result; | 2025 return mojo_factory_result; |
| 1868 } | 2026 } |
| 1869 | 2027 |
| 1870 dynamic handleMessage(bindings.ServiceMessage message) { | 2028 dynamic handleMessage(bindings.ServiceMessage message) { |
| 1871 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 2029 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 1872 return bindings.ControlMessageHandler.handleMessage(this, | 2030 return bindings.ControlMessageHandler.handleMessage(this, |
| 1873 3, | 2031 0, |
| 1874 message); | 2032 message); |
| 1875 } | 2033 } |
| 1876 assert(_impl != null); | 2034 assert(_impl != null); |
| 1877 switch (message.header.type) { | 2035 switch (message.header.type) { |
| 1878 case kIntegerAccessor_getInteger_name: | 2036 case kPathService_getAppDataDir_name: |
| 1879 var params = IntegerAccessorGetIntegerParams.deserialize( | 2037 var params = PathServiceGetAppDataDirParams.deserialize( |
| 1880 message.payload); | 2038 message.payload); |
| 1881 var response = _impl.getInteger(_IntegerAccessorGetIntegerResponseParams
Factory); | 2039 var response = _impl.getAppDataDir(_PathServiceGetAppDataDirResponsePara
msFactory); |
| 1882 if (response is Future) { | 2040 if (response is Future) { |
| 1883 return response.then((response) { | 2041 return response.then((response) { |
| 1884 if (response != null) { | 2042 if (response != null) { |
| 1885 return buildResponseWithId( | 2043 return buildResponseWithId( |
| 1886 response, | 2044 response, |
| 1887 kIntegerAccessor_getInteger_name, | 2045 kPathService_getAppDataDir_name, |
| 1888 message.header.requestId, | 2046 message.header.requestId, |
| 1889 bindings.MessageHeader.kMessageIsResponse); | 2047 bindings.MessageHeader.kMessageIsResponse); |
| 1890 } | 2048 } |
| 1891 }); | 2049 }); |
| 1892 } else if (response != null) { | 2050 } else if (response != null) { |
| 1893 return buildResponseWithId( | 2051 return buildResponseWithId( |
| 1894 response, | 2052 response, |
| 1895 kIntegerAccessor_getInteger_name, | 2053 kPathService_getAppDataDir_name, |
| 1896 message.header.requestId, | 2054 message.header.requestId, |
| 1897 bindings.MessageHeader.kMessageIsResponse); | 2055 bindings.MessageHeader.kMessageIsResponse); |
| 1898 } | 2056 } |
| 1899 break; | 2057 break; |
| 1900 case kIntegerAccessor_setInteger_name: | 2058 case kPathService_getFilesDir_name: |
| 1901 var params = IntegerAccessorSetIntegerParams.deserialize( | 2059 var params = PathServiceGetFilesDirParams.deserialize( |
| 1902 message.payload); | 2060 message.payload); |
| 1903 _impl.setInteger(params.data, params.type); | 2061 var response = _impl.getFilesDir(_PathServiceGetFilesDirResponseParamsFa
ctory); |
| 2062 if (response is Future) { |
| 2063 return response.then((response) { |
| 2064 if (response != null) { |
| 2065 return buildResponseWithId( |
| 2066 response, |
| 2067 kPathService_getFilesDir_name, |
| 2068 message.header.requestId, |
| 2069 bindings.MessageHeader.kMessageIsResponse); |
| 2070 } |
| 2071 }); |
| 2072 } else if (response != null) { |
| 2073 return buildResponseWithId( |
| 2074 response, |
| 2075 kPathService_getFilesDir_name, |
| 2076 message.header.requestId, |
| 2077 bindings.MessageHeader.kMessageIsResponse); |
| 2078 } |
| 2079 break; |
| 2080 case kPathService_getCacheDir_name: |
| 2081 var params = PathServiceGetCacheDirParams.deserialize( |
| 2082 message.payload); |
| 2083 var response = _impl.getCacheDir(_PathServiceGetCacheDirResponseParamsFa
ctory); |
| 2084 if (response is Future) { |
| 2085 return response.then((response) { |
| 2086 if (response != null) { |
| 2087 return buildResponseWithId( |
| 2088 response, |
| 2089 kPathService_getCacheDir_name, |
| 2090 message.header.requestId, |
| 2091 bindings.MessageHeader.kMessageIsResponse); |
| 2092 } |
| 2093 }); |
| 2094 } else if (response != null) { |
| 2095 return buildResponseWithId( |
| 2096 response, |
| 2097 kPathService_getCacheDir_name, |
| 2098 message.header.requestId, |
| 2099 bindings.MessageHeader.kMessageIsResponse); |
| 2100 } |
| 1904 break; | 2101 break; |
| 1905 default: | 2102 default: |
| 1906 throw new bindings.MojoCodecError("Unexpected message name"); | 2103 throw new bindings.MojoCodecError("Unexpected message name"); |
| 1907 break; | 2104 break; |
| 1908 } | 2105 } |
| 1909 return null; | 2106 return null; |
| 1910 } | 2107 } |
| 1911 | 2108 |
| 1912 IntegerAccessor get impl => _impl; | 2109 PathService get impl => _impl; |
| 1913 set impl(IntegerAccessor d) { | 2110 set impl(PathService d) { |
| 1914 assert(_impl == null); | 2111 assert(_impl == null); |
| 1915 _impl = d; | 2112 _impl = d; |
| 1916 } | 2113 } |
| 1917 | 2114 |
| 1918 String toString() { | 2115 String toString() { |
| 1919 var superString = super.toString(); | 2116 var superString = super.toString(); |
| 1920 return "IntegerAccessorStub($superString)"; | 2117 return "PathServiceStub($superString)"; |
| 1921 } | 2118 } |
| 1922 | 2119 |
| 1923 int get version => 3; | 2120 int get version => 0; |
| 1924 } | 2121 } |
| 1925 | 2122 |
| 1926 const int kSampleInterface_sampleMethod1_name = 1; | 2123 const int kUserFeedback_performHapticFeedback_name = 0; |
| 1927 const int kSampleInterface_sampleMethod0_name = 0; | 2124 const int kUserFeedback_performAuralFeedback_name = 1; |
| 1928 const int kSampleInterface_sampleMethod2_name = 2; | |
| 1929 | 2125 |
| 1930 const String SampleInterfaceName = | 2126 const String UserFeedbackName = |
| 1931 'sample::SampleInterface'; | 2127 'activity::UserFeedback'; |
| 1932 | 2128 |
| 1933 abstract class SampleInterface { | 2129 abstract class UserFeedback { |
| 1934 dynamic sampleMethod1(int in1,String in2,[Function responseFactory = null]); | 2130 void performHapticFeedback(HapticFeedbackType type); |
| 1935 void sampleMethod0(); | 2131 void performAuralFeedback(AuralFeedbackType type); |
| 1936 void sampleMethod2(); | |
| 1937 | 2132 |
| 1938 } | 2133 } |
| 1939 | 2134 |
| 1940 | 2135 |
| 1941 class SampleInterfaceProxyImpl extends bindings.Proxy { | 2136 class UserFeedbackProxyImpl extends bindings.Proxy { |
| 1942 SampleInterfaceProxyImpl.fromEndpoint( | 2137 UserFeedbackProxyImpl.fromEndpoint( |
| 1943 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 2138 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 1944 | 2139 |
| 1945 SampleInterfaceProxyImpl.fromHandle(core.MojoHandle handle) : | 2140 UserFeedbackProxyImpl.fromHandle(core.MojoHandle handle) : |
| 1946 super.fromHandle(handle); | 2141 super.fromHandle(handle); |
| 1947 | 2142 |
| 1948 SampleInterfaceProxyImpl.unbound() : super.unbound(); | 2143 UserFeedbackProxyImpl.unbound() : super.unbound(); |
| 1949 | 2144 |
| 1950 static SampleInterfaceProxyImpl newFromEndpoint( | 2145 static UserFeedbackProxyImpl newFromEndpoint( |
| 1951 core.MojoMessagePipeEndpoint endpoint) { | 2146 core.MojoMessagePipeEndpoint endpoint) { |
| 1952 assert(endpoint.setDescription("For SampleInterfaceProxyImpl")); | 2147 assert(endpoint.setDescription("For UserFeedbackProxyImpl")); |
| 1953 return new SampleInterfaceProxyImpl.fromEndpoint(endpoint); | 2148 return new UserFeedbackProxyImpl.fromEndpoint(endpoint); |
| 1954 } | 2149 } |
| 1955 | 2150 |
| 1956 String get name => SampleInterfaceName; | 2151 String get name => UserFeedbackName; |
| 1957 | 2152 |
| 1958 void handleResponse(bindings.ServiceMessage message) { | 2153 void handleResponse(bindings.ServiceMessage message) { |
| 1959 switch (message.header.type) { | 2154 switch (message.header.type) { |
| 1960 case kSampleInterface_sampleMethod1_name: | |
| 1961 var r = SampleInterfaceSampleMethod1ResponseParams.deserialize( | |
| 1962 message.payload); | |
| 1963 if (!message.header.hasRequestId) { | |
| 1964 proxyError("Expected a message with a valid request Id."); | |
| 1965 return; | |
| 1966 } | |
| 1967 Completer c = completerMap[message.header.requestId]; | |
| 1968 if (c == null) { | |
| 1969 proxyError( | |
| 1970 "Message had unknown request Id: ${message.header.requestId}"); | |
| 1971 return; | |
| 1972 } | |
| 1973 completerMap.remove(message.header.requestId); | |
| 1974 if (c.isCompleted) { | |
| 1975 proxyError("Response completer already completed"); | |
| 1976 return; | |
| 1977 } | |
| 1978 c.complete(r); | |
| 1979 break; | |
| 1980 default: | 2155 default: |
| 1981 proxyError("Unexpected message type: ${message.header.type}"); | 2156 proxyError("Unexpected message type: ${message.header.type}"); |
| 1982 close(immediate: true); | 2157 close(immediate: true); |
| 1983 break; | 2158 break; |
| 1984 } | 2159 } |
| 1985 } | 2160 } |
| 1986 | 2161 |
| 1987 String toString() { | 2162 String toString() { |
| 1988 var superString = super.toString(); | 2163 var superString = super.toString(); |
| 1989 return "SampleInterfaceProxyImpl($superString)"; | 2164 return "UserFeedbackProxyImpl($superString)"; |
| 1990 } | 2165 } |
| 1991 } | 2166 } |
| 1992 | 2167 |
| 1993 | 2168 |
| 1994 class _SampleInterfaceProxyCalls implements SampleInterface { | 2169 class _UserFeedbackProxyCalls implements UserFeedback { |
| 1995 SampleInterfaceProxyImpl _proxyImpl; | 2170 UserFeedbackProxyImpl _proxyImpl; |
| 1996 | 2171 |
| 1997 _SampleInterfaceProxyCalls(this._proxyImpl); | 2172 _UserFeedbackProxyCalls(this._proxyImpl); |
| 1998 dynamic sampleMethod1(int in1,String in2,[Function responseFactory = null])
{ | 2173 void performHapticFeedback(HapticFeedbackType type) { |
| 1999 var params = new SampleInterfaceSampleMethod1Params(); | |
| 2000 params.in1 = in1; | |
| 2001 params.in2 = in2; | |
| 2002 return _proxyImpl.sendMessageWithRequestId( | |
| 2003 params, | |
| 2004 kSampleInterface_sampleMethod1_name, | |
| 2005 -1, | |
| 2006 bindings.MessageHeader.kMessageExpectsResponse); | |
| 2007 } | |
| 2008 void sampleMethod0() { | |
| 2009 if (!_proxyImpl.isBound) { | 2174 if (!_proxyImpl.isBound) { |
| 2010 _proxyImpl.proxyError("The Proxy is closed."); | 2175 _proxyImpl.proxyError("The Proxy is closed."); |
| 2011 return; | 2176 return; |
| 2012 } | 2177 } |
| 2013 var params = new SampleInterfaceSampleMethod0Params(); | 2178 var params = new UserFeedbackPerformHapticFeedbackParams(); |
| 2014 _proxyImpl.sendMessage(params, kSampleInterface_sampleMethod0_name); | 2179 params.type = type; |
| 2180 _proxyImpl.sendMessage(params, kUserFeedback_performHapticFeedback_name); |
| 2015 } | 2181 } |
| 2016 | 2182 |
| 2017 void sampleMethod2() { | 2183 void performAuralFeedback(AuralFeedbackType type) { |
| 2018 if (!_proxyImpl.isBound) { | 2184 if (!_proxyImpl.isBound) { |
| 2019 _proxyImpl.proxyError("The Proxy is closed."); | 2185 _proxyImpl.proxyError("The Proxy is closed."); |
| 2020 return; | 2186 return; |
| 2021 } | 2187 } |
| 2022 var params = new SampleInterfaceSampleMethod2Params(); | 2188 var params = new UserFeedbackPerformAuralFeedbackParams(); |
| 2023 _proxyImpl.sendMessage(params, kSampleInterface_sampleMethod2_name); | 2189 params.type = type; |
| 2190 _proxyImpl.sendMessage(params, kUserFeedback_performAuralFeedback_name); |
| 2024 } | 2191 } |
| 2025 | 2192 |
| 2026 } | 2193 } |
| 2027 | 2194 |
| 2028 | 2195 |
| 2029 class SampleInterfaceProxy implements bindings.ProxyBase { | 2196 class UserFeedbackProxy implements bindings.ProxyBase { |
| 2030 final bindings.Proxy impl; | 2197 final bindings.Proxy impl; |
| 2031 SampleInterface ptr; | 2198 UserFeedback ptr; |
| 2032 final String name = SampleInterfaceName; | 2199 final String name = UserFeedbackName; |
| 2033 | 2200 |
| 2034 SampleInterfaceProxy(SampleInterfaceProxyImpl proxyImpl) : | 2201 UserFeedbackProxy(UserFeedbackProxyImpl proxyImpl) : |
| 2035 impl = proxyImpl, | 2202 impl = proxyImpl, |
| 2036 ptr = new _SampleInterfaceProxyCalls(proxyImpl); | 2203 ptr = new _UserFeedbackProxyCalls(proxyImpl); |
| 2037 | 2204 |
| 2038 SampleInterfaceProxy.fromEndpoint( | 2205 UserFeedbackProxy.fromEndpoint( |
| 2039 core.MojoMessagePipeEndpoint endpoint) : | 2206 core.MojoMessagePipeEndpoint endpoint) : |
| 2040 impl = new SampleInterfaceProxyImpl.fromEndpoint(endpoint) { | 2207 impl = new UserFeedbackProxyImpl.fromEndpoint(endpoint) { |
| 2041 ptr = new _SampleInterfaceProxyCalls(impl); | 2208 ptr = new _UserFeedbackProxyCalls(impl); |
| 2042 } | 2209 } |
| 2043 | 2210 |
| 2044 SampleInterfaceProxy.fromHandle(core.MojoHandle handle) : | 2211 UserFeedbackProxy.fromHandle(core.MojoHandle handle) : |
| 2045 impl = new SampleInterfaceProxyImpl.fromHandle(handle) { | 2212 impl = new UserFeedbackProxyImpl.fromHandle(handle) { |
| 2046 ptr = new _SampleInterfaceProxyCalls(impl); | 2213 ptr = new _UserFeedbackProxyCalls(impl); |
| 2047 } | 2214 } |
| 2048 | 2215 |
| 2049 SampleInterfaceProxy.unbound() : | 2216 UserFeedbackProxy.unbound() : |
| 2050 impl = new SampleInterfaceProxyImpl.unbound() { | 2217 impl = new UserFeedbackProxyImpl.unbound() { |
| 2051 ptr = new _SampleInterfaceProxyCalls(impl); | 2218 ptr = new _UserFeedbackProxyCalls(impl); |
| 2052 } | 2219 } |
| 2053 | 2220 |
| 2054 factory SampleInterfaceProxy.connectToService( | 2221 factory UserFeedbackProxy.connectToService( |
| 2055 bindings.ServiceConnector s, String url) { | 2222 bindings.ServiceConnector s, String url) { |
| 2056 SampleInterfaceProxy p = new SampleInterfaceProxy.unbound(); | 2223 UserFeedbackProxy p = new UserFeedbackProxy.unbound(); |
| 2057 s.connectToService(url, p); | 2224 s.connectToService(url, p); |
| 2058 return p; | 2225 return p; |
| 2059 } | 2226 } |
| 2060 | 2227 |
| 2061 static SampleInterfaceProxy newFromEndpoint( | 2228 static UserFeedbackProxy newFromEndpoint( |
| 2062 core.MojoMessagePipeEndpoint endpoint) { | 2229 core.MojoMessagePipeEndpoint endpoint) { |
| 2063 assert(endpoint.setDescription("For SampleInterfaceProxy")); | 2230 assert(endpoint.setDescription("For UserFeedbackProxy")); |
| 2064 return new SampleInterfaceProxy.fromEndpoint(endpoint); | 2231 return new UserFeedbackProxy.fromEndpoint(endpoint); |
| 2065 } | 2232 } |
| 2066 | 2233 |
| 2067 Future close({bool immediate: false}) => impl.close(immediate: immediate); | 2234 Future close({bool immediate: false}) => impl.close(immediate: immediate); |
| 2068 | 2235 |
| 2069 Future responseOrError(Future f) => impl.responseOrError(f); | 2236 Future responseOrError(Future f) => impl.responseOrError(f); |
| 2070 | 2237 |
| 2071 Future get errorFuture => impl.errorFuture; | 2238 Future get errorFuture => impl.errorFuture; |
| 2072 | 2239 |
| 2073 int get version => impl.version; | 2240 int get version => impl.version; |
| 2074 | 2241 |
| 2075 Future<int> queryVersion() => impl.queryVersion(); | 2242 Future<int> queryVersion() => impl.queryVersion(); |
| 2076 | 2243 |
| 2077 void requireVersion(int requiredVersion) { | 2244 void requireVersion(int requiredVersion) { |
| 2078 impl.requireVersion(requiredVersion); | 2245 impl.requireVersion(requiredVersion); |
| 2079 } | 2246 } |
| 2080 | 2247 |
| 2081 String toString() { | 2248 String toString() { |
| 2082 return "SampleInterfaceProxy($impl)"; | 2249 return "UserFeedbackProxy($impl)"; |
| 2083 } | 2250 } |
| 2084 } | 2251 } |
| 2085 | 2252 |
| 2086 | 2253 |
| 2087 class SampleInterfaceStub extends bindings.Stub { | 2254 class UserFeedbackStub extends bindings.Stub { |
| 2088 SampleInterface _impl = null; | 2255 UserFeedback _impl = null; |
| 2089 | 2256 |
| 2090 SampleInterfaceStub.fromEndpoint( | 2257 UserFeedbackStub.fromEndpoint( |
| 2091 core.MojoMessagePipeEndpoint endpoint, [this._impl]) | 2258 core.MojoMessagePipeEndpoint endpoint, [this._impl]) |
| 2092 : super.fromEndpoint(endpoint); | 2259 : super.fromEndpoint(endpoint); |
| 2093 | 2260 |
| 2094 SampleInterfaceStub.fromHandle(core.MojoHandle handle, [this._impl]) | 2261 UserFeedbackStub.fromHandle(core.MojoHandle handle, [this._impl]) |
| 2095 : super.fromHandle(handle); | 2262 : super.fromHandle(handle); |
| 2096 | 2263 |
| 2097 SampleInterfaceStub.unbound() : super.unbound(); | 2264 UserFeedbackStub.unbound() : super.unbound(); |
| 2098 | 2265 |
| 2099 static SampleInterfaceStub newFromEndpoint( | 2266 static UserFeedbackStub newFromEndpoint( |
| 2100 core.MojoMessagePipeEndpoint endpoint) { | 2267 core.MojoMessagePipeEndpoint endpoint) { |
| 2101 assert(endpoint.setDescription("For SampleInterfaceStub")); | 2268 assert(endpoint.setDescription("For UserFeedbackStub")); |
| 2102 return new SampleInterfaceStub.fromEndpoint(endpoint); | 2269 return new UserFeedbackStub.fromEndpoint(endpoint); |
| 2103 } | 2270 } |
| 2104 | 2271 |
| 2105 static const String name = SampleInterfaceName; | 2272 static const String name = UserFeedbackName; |
| 2106 | 2273 |
| 2107 | 2274 |
| 2108 SampleInterfaceSampleMethod1ResponseParams _SampleInterfaceSampleMethod1Respon
seParamsFactory(String out1, Enum out2) { | |
| 2109 var mojo_factory_result = new SampleInterfaceSampleMethod1ResponseParams(); | |
| 2110 mojo_factory_result.out1 = out1; | |
| 2111 mojo_factory_result.out2 = out2; | |
| 2112 return mojo_factory_result; | |
| 2113 } | |
| 2114 | 2275 |
| 2115 dynamic handleMessage(bindings.ServiceMessage message) { | 2276 dynamic handleMessage(bindings.ServiceMessage message) { |
| 2116 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 2277 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 2117 return bindings.ControlMessageHandler.handleMessage(this, | 2278 return bindings.ControlMessageHandler.handleMessage(this, |
| 2118 0, | 2279 0, |
| 2119 message); | 2280 message); |
| 2120 } | 2281 } |
| 2121 assert(_impl != null); | 2282 assert(_impl != null); |
| 2122 switch (message.header.type) { | 2283 switch (message.header.type) { |
| 2123 case kSampleInterface_sampleMethod1_name: | 2284 case kUserFeedback_performHapticFeedback_name: |
| 2124 var params = SampleInterfaceSampleMethod1Params.deserialize( | 2285 var params = UserFeedbackPerformHapticFeedbackParams.deserialize( |
| 2125 message.payload); | 2286 message.payload); |
| 2126 var response = _impl.sampleMethod1(params.in1,params.in2,_SampleInterfac
eSampleMethod1ResponseParamsFactory); | 2287 _impl.performHapticFeedback(params.type); |
| 2127 if (response is Future) { | |
| 2128 return response.then((response) { | |
| 2129 if (response != null) { | |
| 2130 return buildResponseWithId( | |
| 2131 response, | |
| 2132 kSampleInterface_sampleMethod1_name, | |
| 2133 message.header.requestId, | |
| 2134 bindings.MessageHeader.kMessageIsResponse); | |
| 2135 } | |
| 2136 }); | |
| 2137 } else if (response != null) { | |
| 2138 return buildResponseWithId( | |
| 2139 response, | |
| 2140 kSampleInterface_sampleMethod1_name, | |
| 2141 message.header.requestId, | |
| 2142 bindings.MessageHeader.kMessageIsResponse); | |
| 2143 } | |
| 2144 break; | 2288 break; |
| 2145 case kSampleInterface_sampleMethod0_name: | 2289 case kUserFeedback_performAuralFeedback_name: |
| 2146 var params = SampleInterfaceSampleMethod0Params.deserialize( | 2290 var params = UserFeedbackPerformAuralFeedbackParams.deserialize( |
| 2147 message.payload); | 2291 message.payload); |
| 2148 _impl.sampleMethod0(); | 2292 _impl.performAuralFeedback(params.type); |
| 2149 break; | |
| 2150 case kSampleInterface_sampleMethod2_name: | |
| 2151 var params = SampleInterfaceSampleMethod2Params.deserialize( | |
| 2152 message.payload); | |
| 2153 _impl.sampleMethod2(); | |
| 2154 break; | 2293 break; |
| 2155 default: | 2294 default: |
| 2156 throw new bindings.MojoCodecError("Unexpected message name"); | 2295 throw new bindings.MojoCodecError("Unexpected message name"); |
| 2157 break; | 2296 break; |
| 2158 } | 2297 } |
| 2159 return null; | 2298 return null; |
| 2160 } | 2299 } |
| 2161 | 2300 |
| 2162 SampleInterface get impl => _impl; | 2301 UserFeedback get impl => _impl; |
| 2163 set impl(SampleInterface d) { | 2302 set impl(UserFeedback d) { |
| 2164 assert(_impl == null); | 2303 assert(_impl == null); |
| 2165 _impl = d; | 2304 _impl = d; |
| 2166 } | 2305 } |
| 2167 | 2306 |
| 2168 String toString() { | 2307 String toString() { |
| 2169 var superString = super.toString(); | 2308 var superString = super.toString(); |
| 2170 return "SampleInterfaceStub($superString)"; | 2309 return "UserFeedbackStub($superString)"; |
| 2171 } | 2310 } |
| 2172 | 2311 |
| 2173 int get version => 0; | 2312 int get version => 0; |
| 2174 } | 2313 } |
| 2175 | 2314 |
| 2176 | 2315 |
| OLD | NEW |