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

Unified Diff: third_party/mojo/src/mojo/public/go/application/application_impl.go

Issue 1127293003: Update mojo sdk to rev f84766d3b6420b7cf6a113d9d65d73cb5fe18d90 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting Created 5 years, 7 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/go/application/application_impl.go
diff --git a/third_party/mojo/src/mojo/public/go/application/application_impl.go b/third_party/mojo/src/mojo/public/go/application/application_impl.go
index 43a1eb83eff8a48ba3d5f030b8a718a4c7a8f733..ac6fc75e39cc18b741a34be123225d11d24aeb50 100644
--- a/third_party/mojo/src/mojo/public/go/application/application_impl.go
+++ b/third_party/mojo/src/mojo/public/go/application/application_impl.go
@@ -47,6 +47,9 @@ type Context interface {
// should pass a list of services you want to provide to the requested
// application.
ConnectToApplication(remoteURL string, providedServices ...ServiceFactory) *OutgoingConnection
+
+ // Close closes the main run loop for this application.
+ Close()
}
// ApplicationImpl is an utility class for communicating with the Shell, and
@@ -78,8 +81,10 @@ func Run(delegate Delegate, applicationRequest system.MojoHandle) {
impl.runner = stub
for {
if err := stub.ServeRequest(); err != nil {
- // TODO(rogulenko): don't log in case message pipe was closed
- log.Println(err)
+ connectionError, ok := err.(*bindings.ConnectionError)
+ if !ok || !connectionError.Closed() {
+ log.Println(err)
+ }
impl.RequestQuit()
break
}
@@ -145,6 +150,10 @@ func (impl *ApplicationImpl) ConnectToApplication(remoteURL string, providedServ
return connection.ProvideServices(providedServices...)
}
+func (impl *ApplicationImpl) Close() {
+ impl.RequestQuit()
+}
+
// addConnection appends connections slice by a provided connection, removing
// connections that have been closed.
func (impl *ApplicationImpl) addConnection(c *Connection) {
« no previous file with comments | « third_party/mojo/src/mojo/public/dart/src/message.dart ('k') | third_party/mojo/src/mojo/public/go/application/connection.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698