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

Unified Diff: client/dom/src/native_DOMPublic.dart

Issue 9290020: Add support for native bindings generation to dartgenerator.py. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: . Created 8 years, 11 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: client/dom/src/native_DOMPublic.dart
diff --git a/client/dom/src/native_DOMPublic.dart b/client/dom/src/native_DOMPublic.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a5e0f2efdd8bed1ea61d206d6e11cf04a69a0f6a
--- /dev/null
+++ b/client/dom/src/native_DOMPublic.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2011, 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.
+
+// This API is exploratory.
+spawnDomIsolate(Window targetWindow, String entryPoint) {
+ if (targetWindow is! DOMWindowImplementation && targetWindow is! DOMWindowCrossFrameImplementation) {
+ throw 'Bad window argument: $targetWindow';
+ }
+ final result = new Completer<SendPort>();
+ final port = Utils.spawnDomIsolate(targetWindow, entryPoint);
+ window.setTimeout(() { result.complete(port); }, 0);
+ return result.future;
+}
+
+// layoutTestController implementation.
+// FIXME: provide a separate lib for layoutTestController.
+
+var _layoutTestController;
+
+LayoutTestController get layoutTestController() {
+ if (_layoutTestController === null)
+ _layoutTestController = new LayoutTestController._(NPObject.retrieve("layoutTestController"));
+ return _layoutTestController;
+}
+
+class LayoutTestController {
+ final NPObject _npObject;
+
+ LayoutTestController._(this._npObject);
+
+ dumpAsText() => _npObject.invoke('dumpAsText');
+ notifyDone() => _npObject.invoke('notifyDone');
+ setCanOpenWindows() => _npObject.invoke('setCanOpenWindows');
+ waitUntilDone() => _npObject.invoke('waitUntilDone');
+}

Powered by Google App Engine
This is Rietveld 408576698