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

Side by Side Diff: third_party/mojo/src/mojo/public/go/application/connection.go

Issue 1127293003: Update mojo sdk to rev f84766d3b6420b7cf6a113d9d65d73cb5fe18d90 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge IPC fixes 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package application 5 package application
6 6
7 import ( 7 import (
8 "log" 8 "log"
9 9
10 "mojo/public/go/bindings" 10 "mojo/public/go/bindings"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 provider := &serviceProviderImpl{ 104 provider := &serviceProviderImpl{
105 make(map[string]ServiceFactory), 105 make(map[string]ServiceFactory),
106 } 106 }
107 for _, service := range services { 107 for _, service := range services {
108 provider.AddService(service) 108 provider.AddService(service)
109 } 109 }
110 c.localServices = sp.NewServiceProviderStub(*c.servicesRequest, provider , bindings.GetAsyncWaiter()) 110 c.localServices = sp.NewServiceProviderStub(*c.servicesRequest, provider , bindings.GetAsyncWaiter())
111 go func() { 111 go func() {
112 for { 112 for {
113 if err := c.localServices.ServeRequest(); err != nil { 113 if err := c.localServices.ServeRequest(); err != nil {
114 » » » » // TODO(rogulenko): don't log in case message pi pe was closed 114 » » » » connectionError, ok := err.(*bindings.Connection Error)
115 » » » » log.Println(err) 115 » » » » if !ok || !connectionError.Closed() {
116 » » » » » log.Println(err)
117 » » » » }
116 break 118 break
117 } 119 }
118 } 120 }
119 }() 121 }()
120 return c.outgoingConnection 122 return c.outgoingConnection
121 } 123 }
122 124
123 // Close closes both incoming and outgoing parts of the connection. 125 // Close closes both incoming and outgoing parts of the connection.
124 func (c *Connection) Close() { 126 func (c *Connection) Close() {
125 if c.servicesRequest != nil { 127 if c.servicesRequest != nil {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 messagePipe.Close() 167 messagePipe.Close()
166 return nil 168 return nil
167 } 169 }
168 factory.Create(messagePipe) 170 factory.Create(messagePipe)
169 return nil 171 return nil
170 } 172 }
171 173
172 func (sp *serviceProviderImpl) AddService(factory ServiceFactory) { 174 func (sp *serviceProviderImpl) AddService(factory ServiceFactory) {
173 sp.factories[factory.Name()] = factory 175 sp.factories[factory.Name()] = factory
174 } 176 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698