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

Unified Diff: corelib/src/promise.dart

Issue 8383034: Rename various Proxy classes. Provide a Proxy interface. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 2 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
Index: corelib/src/promise.dart
===================================================================
--- corelib/src/promise.dart (revision 626)
+++ corelib/src/promise.dart (working copy)
@@ -90,15 +90,29 @@
}
-class Proxy extends ProxyImpl {
+interface Proxy factory ProxyImpl {
- Proxy.forPort(SendPort port)
+ Proxy.forPort(SendPort port);
+ Proxy.forIsolate(Isolate isolate);
+ Proxy._forIsolateWithPromise(Isolate isolate, Promise<SendPort> promise);
+ /*
+ * The [Proxy.forReply] constructor is used to create a proxy for
+ * the object that will be the reply to a message send.
+ */
+ Proxy.forReply(Promise<SendPort> port);
+
+}
+
+
+class ProxyImpl extends ProxyBase implements Proxy {
+
+ ProxyImpl.forPort(SendPort port)
: super.forPort(port) { }
- Proxy.forIsolate(Isolate isolate)
+ ProxyImpl.forIsolate(Isolate isolate)
: this._forIsolateWithPromise(isolate, new Promise<SendPort>());
- Proxy._forIsolateWithPromise(Isolate isolate, Promise<SendPort> promise)
+ ProxyImpl._forIsolateWithPromise(Isolate isolate, Promise<SendPort> promise)
// TODO(floitsch): it seems wrong to call super.forReply here.
: super.forReply(promise) {
isolate.spawn().then((SendPort port) {
@@ -110,7 +124,7 @@
* The [Proxy.forReply] constructor is used to create a proxy for
* the object that will be the reply to a message send.
*/
- Proxy.forReply(Promise<SendPort> port)
+ ProxyImpl.forReply(Promise<SendPort> port)
: super.forReply(port) { }
}
@@ -130,7 +144,7 @@
}
static SendPort serve(Dispatcher dispatcher) {
- ReceivePort port = ProxyImpl.register(dispatcher);
+ ReceivePort port = ProxyBase.register(dispatcher);
dispatcher._serve(port);
return port.toSendPort();
}

Powered by Google App Engine
This is Rietveld 408576698