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

Unified Diff: third_party/mojo/src/mojo/public/python/mojo_application/application_impl.py

Issue 1348903003: third_party/mojo: Remove python/go/dart bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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: third_party/mojo/src/mojo/public/python/mojo_application/application_impl.py
diff --git a/third_party/mojo/src/mojo/public/python/mojo_application/application_impl.py b/third_party/mojo/src/mojo/public/python/mojo_application/application_impl.py
deleted file mode 100644
index 80b0376853e512a03f658b32d4a81faa2121e44c..0000000000000000000000000000000000000000
--- a/third_party/mojo/src/mojo/public/python/mojo_application/application_impl.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 2015 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.
-
-"""Python implementation of the Application interface."""
-
-import application_mojom
-import service_provider_mojom
-import shell_mojom
-from mojo_application.service_provider_impl import ServiceProviderImpl
-
-import mojo_system
-
-class ApplicationImpl(application_mojom.Application):
- def __init__(self, delegate, app_request_handle):
- self.shell = None
- self.url = None
- self.args = None
- self._delegate = delegate
- self._providers = []
- application_mojom.Application.manager.Bind(self, app_request_handle)
-
- def Initialize(self, shell, url, args):
- self.shell = shell
- self.url = url
- self.args = args
- self._delegate.Initialize(shell, self)
-
- def AcceptConnection(self, requestor_url, services, exposed_services,
- resolved_url):
- service_provider = ServiceProviderImpl(services)
- if self._delegate.OnAcceptConnection(requestor_url, resolved_url,
- service_provider, exposed_services):
- # We keep a reference to ServiceProviderImpl to ensure neither it nor
- # |services| gets garbage collected.
- services.Bind(service_provider)
- self._providers.append(service_provider)
-
- def removeServiceProvider():
- self._providers.remove(service_provider)
- service_provider.manager.AddOnErrorCallback(removeServiceProvider)
-
- def ConnectToService(self, application_url, service_class):
- """
- Helper method to connect to a service. |application_url| is the URL of the
- application to be connected to, and |service_class| is the class of the
- service to be connected to. Returns a proxy to the service.
- """
- application_proxy, request = (
- service_provider_mojom.ServiceProvider.manager.NewRequest())
- self.shell.ConnectToApplication(application_url, request, None)
-
- service_proxy, request = service_class.manager.NewRequest()
- application_proxy.ConnectToService(service_class.manager.name,
- request.PassMessagePipe())
-
- return service_proxy

Powered by Google App Engine
This is Rietveld 408576698