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

Unified Diff: sky/examples/dart-mojo.sky

Issue 922893002: Merge the Sky Engine changes from the SkyDart branch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/examples/dart-library.sky ('k') | sky/examples/spinning-square.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/dart-mojo.sky
diff --git a/examples/dart/wget/main.dart b/sky/examples/dart-mojo.sky
similarity index 72%
copy from examples/dart/wget/main.dart
copy to sky/examples/dart-mojo.sky
index d5130634b973fa4ec9419a568e48216d59ef1f55..e69f99e1d0429026db6a947d99401d0f5bfb2f0e 100644
--- a/examples/dart/wget/main.dart
+++ b/sky/examples/dart-mojo.sky
@@ -1,26 +1,26 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Run with, e.g.:
-// mojo_shell "mojo:dart_wget http://www.google.com"
-
+#!mojo mojo:sky_viewer
+<sky>
+<import src="dart-library.sky" as="library" />
+<script>
import 'dart:async';
-import 'dart:mojo_application';
+import '/mojo/public/dart/application.dart';
import 'dart:mojo_bindings';
import 'dart:mojo_core';
import 'dart:typed_data';
+import 'dart:sky.internals' as internals;
import 'package:mojo/services/network/public/interfaces/network_service.mojom.dart';
import 'package:mojo/services/network/public/interfaces/url_loader.mojom.dart';
+import 'package:mojo/public/interfaces/application/shell.mojom.dart' as shell_mojom;
class WGet extends Application {
NetworkServiceProxy _networkService;
UrlLoaderProxy _urlLoaderProxy;
WGet.fromHandle(MojoHandle handle) : super.fromHandle(handle);
+ WGet(MojoMessagePipeEndpoint endpoint) : super(endpoint);
- void initialize(List<String> args, String url) {
+ void initialize(List<String> args) {
run(args);
}
@@ -70,8 +70,13 @@ class WGet extends Application {
}
}
-main(List args) {
- MojoHandle appHandle = new MojoHandle(args[0]);
- var wget = new WGet.fromHandle(appHandle);
+main() {
+ var messagePipe = new MojoMessagePipe();
+ var wget = new WGet(messagePipe.endpoints[1]);
wget.listen();
+ var shellProxy = new shell_mojom.ShellProxy.fromHandle(new MojoHandle(internals.passShellProxyHandle()));
+ wget.initializeFromShellProxy(shellProxy, ["mojo:wget", "http://www.google.com"]);
}
+
+</script>
+</sky>
« no previous file with comments | « sky/examples/dart-library.sky ('k') | sky/examples/spinning-square.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698