diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-10 18:11:26 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-10 18:11:26 +0000 |
commit | 33b7c47777e2b88e6a876cc48a562f03d5dddae4 (patch) | |
tree | 8a54c9b4970ae970d0df0bf8cd6d420fb3d1c3a2 /remoting/client/client_util.cc | |
parent | 8d5c43c4a9958b592565da16912fd44960aab906 (diff) | |
download | chromium_src-33b7c47777e2b88e6a876cc48a562f03d5dddae4.zip chromium_src-33b7c47777e2b88e6a876cc48a562f03d5dddae4.tar.gz chromium_src-33b7c47777e2b88e6a876cc48a562f03d5dddae4.tar.bz2 |
Separate out HostConnection into an interface and a jingle-based
implementation. Refactor to inject the running thread for Jingle.
Review URL: http://codereview.chromium.org/2753006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49419 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client/client_util.cc')
-rw-r--r-- | remoting/client/client_util.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/remoting/client/client_util.cc b/remoting/client/client_util.cc index a6bf1877..2bc50c0 100644 --- a/remoting/client/client_util.cc +++ b/remoting/client/client_util.cc @@ -9,14 +9,14 @@ namespace remoting { // Get host JID from command line arguments, or stdin if not specified. -bool GetLoginInfo(std::string& host_jid, - std::string& username, - std::string& auth_token) { +bool GetLoginInfo(std::string* host_jid, + std::string* username, + std::string* auth_token) { std::cout << "Host JID: "; - std::cin >> host_jid; + std::cin >> *host_jid; std::cin.ignore(); // Consume the leftover '\n' - if (host_jid.find("/chromoting") == std::string::npos) { + if (host_jid->find("/chromoting") == std::string::npos) { std::cerr << "Error: Expected Host JID in format: <jid>/chromoting<id>" << std::endl; return false; @@ -25,23 +25,23 @@ bool GetLoginInfo(std::string& host_jid, // Get username (JID). // Extract default JID from host_jid. std::string default_username; - size_t jid_end = host_jid.find('/'); + size_t jid_end = host_jid->find('/'); if (jid_end != std::string::npos) { - default_username = host_jid.substr(0, jid_end); + default_username = host_jid->substr(0, jid_end); } std::cout << "JID [" << default_username << "]: "; - getline(std::cin, username); - if (username.length() == 0) { - username = default_username; + getline(std::cin, *username); + if (username->length() == 0) { + username->swap(default_username); } - if (username.length() == 0) { + if (username->length() == 0) { std::cerr << "Error: Expected valid JID username" << std::endl; return 1; } // Get authenication token (with console echo turned off). std::cout << "Auth token: "; - getline(std::cin, auth_token); + getline(std::cin, *auth_token); std::cout << std::endl; return true; } |