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

Side by Side Diff: remoting/client/host_connection.cc

Issue 2724010: Revert 49298 - Broke compile - Token-based authentication for chromoting.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 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
« no previous file with comments | « remoting/client/host_connection.h ('k') | remoting/client/simple_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/client/host_connection.h" 5 #include "remoting/client/host_connection.h"
6 6
7 #include "remoting/base/constants.h"
8
9 namespace remoting { 7 namespace remoting {
10 8
11 HostConnection::HostConnection(ProtocolDecoder* decoder, 9 HostConnection::HostConnection(ProtocolDecoder* decoder,
12 EventHandler* handler) 10 EventHandler* handler)
13 : decoder_(decoder), handler_(handler) { 11 : decoder_(decoder), handler_(handler) {
14 } 12 }
15 13
16 HostConnection::~HostConnection() { 14 HostConnection::~HostConnection() {
17 Disconnect(); 15 Disconnect();
18 } 16 }
19 17
20 void HostConnection::Connect(const std::string& username, 18 void HostConnection::Connect(const std::string& username,
21 const std::string& auth_token, 19 const std::string& password,
22 const std::string& host_jid) { 20 const std::string& host_jid) {
23 jingle_client_ = new JingleClient(); 21 jingle_client_ = new JingleClient();
24 jingle_client_->Init(username, auth_token, kChromotingTokenServiceName, this); 22 jingle_client_->Init(username, password, this);
25 jingle_channel_ = jingle_client_->Connect(host_jid, this); 23 jingle_channel_ = jingle_client_->Connect(host_jid, this);
26 } 24 }
27 25
28 void HostConnection::Disconnect() { 26 void HostConnection::Disconnect() {
29 if (jingle_channel_.get()) 27 if (jingle_channel_.get())
30 jingle_channel_->Close(); 28 jingle_channel_->Close();
31 29
32 if (jingle_client_.get()) 30 if (jingle_client_.get())
33 jingle_client_->Close(); 31 jingle_client_->Close();
34 } 32 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // Client rejects all connection. 69 // Client rejects all connection.
72 return false; 70 return false;
73 } 71 }
74 72
75 void HostConnection::OnNewConnection(JingleClient* client, 73 void HostConnection::OnNewConnection(JingleClient* client,
76 scoped_refptr<JingleChannel> channel) { 74 scoped_refptr<JingleChannel> channel) {
77 NOTREACHED() << "SimpleClient can't accept connection."; 75 NOTREACHED() << "SimpleClient can't accept connection.";
78 } 76 }
79 77
80 } // namespace remoting 78 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/host_connection.h ('k') | remoting/client/simple_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698