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

Side by Side Diff: remoting/protocol/connection_to_host.cc

Issue 7008003: Wire in OAuth2 support into non-sandboxed connections in libjingle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "remoting/protocol/connection_to_host.h" 5 #include "remoting/protocol/connection_to_host.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "remoting/base/constants.h" 9 #include "remoting/base/constants.h"
10 #include "remoting/jingle_glue/http_port_allocator.h" 10 #include "remoting/jingle_glue/http_port_allocator.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 HostStub* ConnectionToHost::host_stub() { 48 HostStub* ConnectionToHost::host_stub() {
49 return host_stub_.get(); 49 return host_stub_.get();
50 } 50 }
51 51
52 MessageLoop* ConnectionToHost::message_loop() { 52 MessageLoop* ConnectionToHost::message_loop() {
53 return thread_->message_loop(); 53 return thread_->message_loop();
54 } 54 }
55 55
56 void ConnectionToHost::Connect(const std::string& username, 56 void ConnectionToHost::Connect(const std::string& username,
57 const std::string& auth_token, 57 const std::string& auth_token,
58 const std::string& auth_service,
58 const std::string& host_jid, 59 const std::string& host_jid,
59 const std::string& access_code, 60 const std::string& access_code,
60 HostEventCallback* event_callback, 61 HostEventCallback* event_callback,
61 ClientStub* client_stub, 62 ClientStub* client_stub,
62 VideoStub* video_stub) { 63 VideoStub* video_stub) {
63 event_callback_ = event_callback; 64 event_callback_ = event_callback;
64 client_stub_ = client_stub; 65 client_stub_ = client_stub;
65 video_stub_ = video_stub; 66 video_stub_ = video_stub;
66 access_code_ = access_code; 67 access_code_ = access_code;
67 68
68 // Initialize |jingle_client_|. 69 // Initialize |jingle_client_|.
69 signal_strategy_.reset( 70 signal_strategy_.reset(
70 new XmppSignalStrategy(thread_, username, auth_token, 71 new XmppSignalStrategy(thread_, username, auth_token, auth_service));
71 kChromotingTokenServiceName));
72 jingle_client_ = 72 jingle_client_ =
73 new JingleClient(thread_, signal_strategy_.get(), 73 new JingleClient(thread_, signal_strategy_.get(),
74 network_manager_.release(), socket_factory_.release(), 74 network_manager_.release(), socket_factory_.release(),
75 port_allocator_session_factory_.release(), this); 75 port_allocator_session_factory_.release(), this);
76 jingle_client_->Init(); 76 jingle_client_->Init();
77 77
78 // Save jid of the host. The actual connection is created later after 78 // Save jid of the host. The actual connection is created later after
79 // |jingle_client_| is connected. 79 // |jingle_client_| is connected.
80 host_jid_ = host_jid; 80 host_jid_ = host_jid;
81 } 81 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // Create and enable the input stub now that we're authenticated. 236 // Create and enable the input stub now that we're authenticated.
237 input_stub_.reset(new InputSender(session_->event_channel())); 237 input_stub_.reset(new InputSender(session_->event_channel()));
238 } 238 }
239 239
240 ConnectionToHost::State ConnectionToHost::state() const { 240 ConnectionToHost::State ConnectionToHost::state() const {
241 return state_; 241 return state_;
242 } 242 }
243 243
244 } // namespace protocol 244 } // namespace protocol
245 } // namespace remoting 245 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698