Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: samples/myapi/generated/dart/myapi_service.dart

Issue 1209033003: Work in progres, please take a look and give early feedback if this is the way we want to structure… (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: address comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/myapi/generated/cc/unicode.cc ('k') | samples/myapi/generated/dart/struct.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/myapi/generated/dart/myapi_service.dart
diff --git a/samples/myapi/generated/dart/myapi_service.dart b/samples/myapi/generated/dart/myapi_service.dart
deleted file mode 100644
index eee45f3a7ad6268291cdfa680d64bf413d19eccc..0000000000000000000000000000000000000000
--- a/samples/myapi/generated/dart/myapi_service.dart
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE.md file.
-
-// Generated file. Do not edit.
-
-library myapi_service;
-
-import "dart:ffi";
-import "dart:service" as service;
-
-final Channel _channel = new Channel();
-final Port _port = new Port(_channel);
-final Foreign _postResult = Foreign.lookup("PostResultToService");
-
-bool _terminated = false;
-MyApiService _impl;
-
-abstract class MyApiService {
- int create();
- void destroy(int api);
- int foo(int api);
- void MyObject_funk(int api, int id, int o);
-
- static void initialize(MyApiService impl) {
- if (_impl != null) {
- throw new UnsupportedError("Cannot re-initialize");
- }
- _impl = impl;
- _terminated = false;
- service.register("MyApiService", _port);
- }
-
- static bool hasNextEvent() {
- return !_terminated;
- }
-
- static void handleNextEvent() {
- var request = _channel.receive();
- switch (request.getInt32(0)) {
- case _TERMINATE_METHOD_ID:
- _terminated = true;
- _postResult.vcall$1(request);
- break;
- case _CREATE_METHOD_ID:
- var result = _impl.create();
- request.setInt32(56, result);
- _postResult.vcall$1(request);
- break;
- case _DESTROY_METHOD_ID:
- _impl.destroy(request.getInt32(56));
- _postResult.vcall$1(request);
- break;
- case _FOO_METHOD_ID:
- var result = _impl.foo(request.getInt32(56));
- request.setInt32(56, result);
- _postResult.vcall$1(request);
- break;
- case _MY_OBJECT_FUNK_METHOD_ID:
- _impl.MyObject_funk(request.getInt32(56), request.getInt32(60), request.getInt32(64));
- _postResult.vcall$1(request);
- break;
- default:
- throw new UnsupportedError("Unknown method");
- }
- }
-
- static const int _TERMINATE_METHOD_ID = 0;
- static const int _CREATE_METHOD_ID = 1;
- static const int _DESTROY_METHOD_ID = 2;
- static const int _FOO_METHOD_ID = 3;
- static const int _MY_OBJECT_FUNK_METHOD_ID = 4;
-}
« no previous file with comments | « samples/myapi/generated/cc/unicode.cc ('k') | samples/myapi/generated/dart/struct.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698