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