Chromium Code Reviews| Index: remoting/client/ios/session/remoting_client.mm |
| diff --git a/remoting/client/ios/session/remoting_client.mm b/remoting/client/ios/session/remoting_client.mm |
| index c56275bd169ae27c17f54269db7d6fba9ab39a3a..da636ce29b94f561e15be6f448141d4c73495c0e 100644 |
| --- a/remoting/client/ios/session/remoting_client.mm |
| +++ b/remoting/client/ios/session/remoting_client.mm |
| @@ -66,6 +66,7 @@ NSString* const kHostSessionPin = @"kHostSessionPin"; |
| - (void)connectToHost:(HostInfo*)hostInfo |
| username:(NSString*)username |
| accessToken:(NSString*)accessToken { |
| + DCHECK(_runtime->ui_task_runner()->BelongsToCurrentThread()); |
| DCHECK(hostInfo); |
| DCHECK(hostInfo.jabberId); |
| DCHECK(hostInfo.hostId); |
| @@ -113,21 +114,19 @@ NSString* const kHostSessionPin = @"kHostSessionPin"; |
| _displayHandler = [[GlDisplayHandler alloc] init]; |
| _displayHandler.delegate = self; |
| + |
| + _session.reset(new remoting::ChromotingSession( |
|
Yuwei
2017/05/05 05:28:02
It looks like connectToHost is called on the UI th
nicholss
2017/05/08 15:34:18
I think it is fine unless ->Connect is blocking
Yuwei
2017/05/08 20:45:26
ChromotingSession will just post a task to connect
|
| + _sessonDelegate->GetWeakPtr(), [_displayHandler CreateCursorShapeStub], |
| + [_displayHandler CreateVideoRenderer], audioPlayer, info, |
| + client_auth_config)); |
| + _session->Connect(); |
| + |
| __weak GlDisplayHandler* weakDisplayHandler = _displayHandler; |
| _gestureInterpreter.reset(new remoting::GestureInterpreter( |
| base::BindBlockArc(^(const remoting::ViewMatrix& matrix) { |
| [weakDisplayHandler onPixelTransformationChanged:matrix]; |
| - }))); |
| - |
| - _runtime->ui_task_runner()->PostTask( |
| - FROM_HERE, base::BindBlockArc(^{ |
| - _session.reset(new remoting::ChromotingSession( |
| - _sessonDelegate->GetWeakPtr(), |
| - [_displayHandler CreateCursorShapeStub], |
| - [_displayHandler CreateVideoRenderer], audioPlayer, info, |
| - client_auth_config)); |
| - _session->Connect(); |
| - })); |
| + }), |
| + _session.get())); |
| } |
| #pragma mark - Eventing |