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

Side by Side Diff: sky/framework/embedder.dart

Issue 948463003: Added Sky Mojo embedder singleton, restored network test (Closed) Base URL: https://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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/framework/shell.dart » ('j') | sky/tests/services/network.sky » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 import "/mojo/public/dart/application.dart";
6 import "dart:mojo_bindings" as bindings;
7 import "dart:mojo_core" as core;
8 import "dart:sky.internals" as internals;
9 import "package:mojo/public/interfaces/application/service_provider.mojom.dart";
10 import "package:mojo/public/interfaces/application/shell.mojom.dart";
11
12 final embedder = new EmbedderImpl();
abarth-chromium 2015/02/20 22:51:38 Type pls
hansmuller1 2015/02/20 22:58:54 Done.
13
14 class EmbedderImpl {
abarth-chromium 2015/02/20 22:51:38 EmbedderImpl -> _EmbedderImpl to hide the class.
hansmuller1 2015/02/20 22:58:54 Done.
15 final connections = new List<ApplicationConnection>();
abarth-chromium 2015/02/20 22:51:38 Type pls
hansmuller1 2015/02/20 22:58:54 I removed the field; it shouldn't have been there.
16 var _shell;
abarth-chromium 2015/02/20 22:51:38 Type pls
hansmuller1 2015/02/20 22:58:54 Done.
17
18 ShellProxy shell() {
abarth-chromium 2015/02/20 22:51:38 This should be a getter. Actually, if you make _s
hansmuller1 2015/02/20 22:58:54 Done.
19 if (_shell == null)
20 _shell = new ShellProxy.fromHandle(
21 new core.MojoHandle(internals.takeShellProxyHandle()));
abarth-chromium 2015/02/20 22:51:38 You can do this as an initializer for _shell if yo
hansmuller1 2015/02/20 22:58:54 Done.
22 return _shell;
23 }
24
25 ApplicationConnection connectToApplication(String url) {
26 var proxy = new ServiceProviderProxy.unbound();
27 var stub = new ServiceProviderStub.unbound();
28 shell().connectToApplication(url, proxy, stub);
29 return new ApplicationConnection(stub, proxy);
30 }
31
32 void connectToService(String url, bindings.Proxy proxy) {
33 var appSp = new ServiceProviderProxy.unbound();
34 shell().connectToApplication(url, appSp, null);
35 var pipe = new core.MojoMessagePipe();
36 proxy.bind(pipe.endpoints[0]);
37 appSp.connectToService(proxy.name, pipe.endpoints[1]);
38 appSp.close();
39 }
40 }
OLDNEW
« no previous file with comments | « no previous file | sky/framework/shell.dart » ('j') | sky/tests/services/network.sky » ('J')

Powered by Google App Engine
This is Rietveld 408576698