summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-20 21:46:26 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-20 21:46:26 +0000
commit61be2e5772dd83d9af3f9f07522928ca479c66a3 (patch)
tree94b5d7fcd496040431b3a831c3e1d5342ead3216 /chrome
parentb692a128b073b297a4ce2aa7c468fdd37823e3a8 (diff)
downloadchromium_src-61be2e5772dd83d9af3f9f07522928ca479c66a3.zip
chromium_src-61be2e5772dd83d9af3f9f07522928ca479c66a3.tar.gz
chromium_src-61be2e5772dd83d9af3f9f07522928ca479c66a3.tar.bz2
change host_id over to using uuid
BUG=NONE TEST=BUILD Review URL: http://codereview.chromium.org/6028003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69756 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/service/remoting/remoting_directory_service.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/service/remoting/remoting_directory_service.cc b/chrome/service/remoting/remoting_directory_service.cc
index fbe00206..e61c0fd 100644
--- a/chrome/service/remoting/remoting_directory_service.cc
+++ b/chrome/service/remoting/remoting_directory_service.cc
@@ -7,6 +7,7 @@
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/values.h"
+#include "chrome/common/guid.h"
#include "chrome/common/net/url_request_context_getter.h"
#include "chrome/service/net/service_url_request_context.h"
#include "chrome/service/remoting/remoting_directory_service.h"
@@ -31,15 +32,14 @@ void RemotingDirectoryService::AddHost(const std::string& token) {
host_key_pair_.reset(new remoting::HostKeyPair());
host_key_pair_->Generate();
- // Use the host address as ID and host name.
- std::string hostname = net::GetHostName();
- host_id_ = hostname;
- host_name_ = hostname;
+ // Get a host name and generate a UUID for the request.
+ host_id_ = guid::GenerateGUID();
+ host_name_ = net::GetHostName();
// Prepare the parameters for the request.
DictionaryValue data;
- data.SetString("hostId", hostname);
- data.SetString("hostName", hostname);
+ data.SetString("hostId", host_id_);
+ data.SetString("hostName", host_name_);
data.SetString("publicKey", host_key_pair_->GetPublicKey());
// Generate the final json query.