summaryrefslogtreecommitdiffstats
path: root/remoting/host/simple_host_process.cc
diff options
context:
space:
mode:
authorjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-16 16:30:05 +0000
committerjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-16 16:30:05 +0000
commit066e4710edc8ca309fe7328212ad6cb4c64b6347 (patch)
tree4879c0ac87c8707d97c398f53634171e92cc1460 /remoting/host/simple_host_process.cc
parent357284ba336a2fe71a84bc9456c71a169bad4c6e (diff)
downloadchromium_src-066e4710edc8ca309fe7328212ad6cb4c64b6347.zip
chromium_src-066e4710edc8ca309fe7328212ad6cb4c64b6347.tar.gz
chromium_src-066e4710edc8ca309fe7328212ad6cb4c64b6347.tar.bz2
Store (and check) support id in SupportAccessVerifier.
BUG=None TEST=Manual Review URL: http://codereview.chromium.org/7013065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85492 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/simple_host_process.cc')
-rw-r--r--remoting/host/simple_host_process.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc
index d4e8b4c..691e5b8 100644
--- a/remoting/host/simple_host_process.cc
+++ b/remoting/host/simple_host_process.cc
@@ -108,7 +108,12 @@ class SimpleHost {
}
// Initialize AccessVerifier.
+ // TODO(jamiewalch): For the Me2Mom case, the access verifier is passed to
+ // RegisterSupportHostRequest::Init, so transferring ownership of it to the
+ // ChromotingHost could cause a crash condition at shut-down. Fix this.
scoped_ptr<remoting::AccessVerifier> access_verifier;
+ remoting::RegisterSupportHostRequest::RegisterCallback*
+ register_callback = NULL;
if (me2mom_) {
scoped_ptr<remoting::SupportAccessVerifier> support_access_verifier(
new remoting::SupportAccessVerifier());
@@ -116,6 +121,9 @@ class SimpleHost {
return 1;
std::cout << "Host secret: "
<< support_access_verifier->host_secret() << std::endl;
+ register_callback = NewCallback(
+ support_access_verifier.get(),
+ &remoting::SupportAccessVerifier::OnMe2MomHostRegistered);
access_verifier.reset(support_access_verifier.release());
} else {
scoped_ptr<remoting::SelfAccessVerifier> self_access_verifier(
@@ -149,8 +157,7 @@ class SimpleHost {
if (me2mom_) {
scoped_refptr<remoting::RegisterSupportHostRequest> register_request =
new remoting::RegisterSupportHostRequest();
- if (!register_request->Init(
- config, NewCallback(this, &SimpleHost::OnMe2MomHostRegistered))) {
+ if (!register_request->Init(config, register_callback)) {
return 1;
}
host->AddStatusObserver(register_request);
@@ -197,15 +204,6 @@ class SimpleHost {
return FilePath(home_path).Append(kDefaultConfigPath);
}
- void OnMe2MomHostRegistered(bool successful, const std::string& support_id) {
- if (successful) {
- std::cout << "Support id: "
- << support_id << std::endl;
- } else {
- LOG(ERROR) << "Failed to register support host";
- }
- }
-
FilePath config_path_;
bool fake_;
bool me2mom_;