mirror of
https://github.com/dart-lang/sdk
synced 2024-09-22 14:33:32 +00:00
968fb8ee31
BUG= R=johnmccutchan@google.com Review URL: https://codereview.chromium.org//293013008 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36420 260f80e4-7a28-3924-810f-c04153c831b5
30 lines
744 B
Dart
30 lines
744 B
Dart
// Copyright (c) 2014, the Dart 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 file.
|
|
|
|
part of dart.io;
|
|
|
|
int _nextServiceId = 1;
|
|
|
|
// TODO(ajohnsen): Use other way of getting a uniq id.
|
|
abstract class _ServiceObject {
|
|
int __serviceId = 0;
|
|
int get _serviceId {
|
|
if (__serviceId == 0) __serviceId = _nextServiceId++;
|
|
return __serviceId;
|
|
}
|
|
|
|
Map _toJSON(bool ref);
|
|
|
|
String get _servicePath => "$_serviceTypePath/$_serviceId";
|
|
|
|
String get _serviceTypePath;
|
|
|
|
String get _serviceTypeName;
|
|
|
|
String _serviceType(bool ref) {
|
|
if (ref) return "@$_serviceTypeName";
|
|
return _serviceTypeName;
|
|
}
|
|
}
|