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

Unified Diff: mojo/public/dart/src/application.dart

Issue 959993002: Dart: Removes name conflicts from generated bindings. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Removes unused constructors 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
Index: mojo/public/dart/src/application.dart
diff --git a/mojo/public/dart/src/application.dart b/mojo/public/dart/src/application.dart
index 4be554df1bee1800fdcaaa4981e5e607a6a2ee12..50ad7619e3889894d986565d973fa40a46f081b5 100644
--- a/mojo/public/dart/src/application.dart
+++ b/mojo/public/dart/src/application.dart
@@ -4,33 +4,37 @@
part of application;
-class _ApplicationImpl extends application_mojom.Application {
+class _ApplicationImpl implements application_mojom.Application {
+ application_mojom.ApplicationStub _stub;
shell_mojom.ShellProxy shell;
Application _application;
- _ApplicationImpl(
- Application application, core.MojoMessagePipeEndpoint endpoint)
- : _application = application, super(endpoint) {
- super.delegate = this;
+ _ApplicationImpl(Application application,
+ core.MojoMessagePipeEndpoint endpoint) {
+ _application = application;
+ _stub = new application_mojom.ApplicationStub.fromEndpoint(endpoint)
+ ..delegate = this
+ ..listen();
}
- _ApplicationImpl.fromHandle(Application application, core.MojoHandle handle)
- : _application = application, super.fromHandle(handle) {
- super.delegate = this;
+ _ApplicationImpl.fromHandle(Application application, core.MojoHandle handle) {
+ _application = application;
+ _stub = new application_mojom.ApplicationStub.fromHandle(handle)
+ ..delegate = this
+ ..listen();
}
void initialize(
- shell_mojom.ShellProxy shellProxy, List<String> args, String url) {
+ bindings.ProxyBase shellProxy, List<String> args, String url) {
assert(shell == null);
shell = shellProxy;
_application.initialize(args, url);
}
- void acceptConnection(
- String requestorUrl,
- ServiceProviderStub services,
- ServiceProviderProxy exposedServices) =>
- _application._acceptConnection(requestorUrl, services, exposedServices);
+ void acceptConnection(String requestorUrl,
+ ServiceProviderStub services,
+ bindings.ProxyBase exposedServices) =>
+ _application._acceptConnection(requestorUrl, services, exposedServices);
void requestQuit() => _application._requestQuitAndClose();
@@ -61,28 +65,25 @@ abstract class Application {
// TODO(skydart): This is a temporary fix to allow sky application to consume
// mojo services. Do not use for any other purpose.
void initializeFromShellProxy(shell_mojom.ShellProxy shellProxy,
- List<String> args, String url) {
+ List<String> args, String url) =>
_applicationImpl.initialize(shellProxy, args, url);
- }
// Returns a connection to the app at |url|.
ApplicationConnection connectToApplication(String url) {
var proxy = new ServiceProviderProxy.unbound();
var stub = new ServiceProviderStub.unbound();
- _applicationImpl.shell.connectToApplication(url, proxy, stub);
+ _applicationImpl.shell.ptr.connectToApplication(url, proxy, stub);
var connection = new ApplicationConnection(stub, proxy);
_applicationConnections.add(connection);
return connection;
}
- void connectToService(String url, bindings.Proxy proxy) {
+ void connectToService(String url, bindings.ProxyBase proxy) {
connectToApplication(url).requestService(proxy);
}
void requestQuit() {}
- listen() => _applicationImpl.listen();
-
void _requestQuitAndClose() {
requestQuit();
close();

Powered by Google App Engine
This is Rietveld 408576698