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

Unified Diff: remoting/host/simple_host_process.cc

Issue 8662001: Remove AccessVerifier interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/self_access_verifier_unittest.cc ('k') | remoting/host/support_access_verifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/simple_host_process.cc
diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc
index 99af0712cf96d60d4fa5de56a2390a1722bfe01a..293ad27c56d570129df73b4b0fe9dd943730eb92 100644
--- a/remoting/host/simple_host_process.cc
+++ b/remoting/host/simple_host_process.cc
@@ -41,12 +41,11 @@
#include "remoting/host/disconnect_window.h"
#include "remoting/host/event_executor.h"
#include "remoting/host/heartbeat_sender.h"
+#include "remoting/host/host_secret.h"
#include "remoting/host/local_input_monitor.h"
#include "remoting/host/log_to_server.h"
#include "remoting/host/json_host_config.h"
#include "remoting/host/register_support_host_request.h"
-#include "remoting/host/self_access_verifier.h"
-#include "remoting/host/support_access_verifier.h"
#include "remoting/proto/video.pb.h"
#if defined(TOOLKIT_USES_GTK)
@@ -133,27 +132,16 @@ class SimpleHost {
// ChromotingHost could cause a crash condition if SetIT2MeAccessCode is
// called after the ChromotingHost is destroyed (for example, at shutdown).
// Fix this.
- scoped_ptr<remoting::AccessVerifier> access_verifier;
scoped_ptr<remoting::RegisterSupportHostRequest> register_request;
scoped_ptr<remoting::HeartbeatSender> heartbeat_sender;
scoped_ptr<remoting::LogToServer> log_to_server;
if (is_it2me_) {
- scoped_ptr<remoting::SupportAccessVerifier> support_access_verifier(
- new remoting::SupportAccessVerifier());
register_request.reset(new remoting::RegisterSupportHostRequest());
if (!register_request->Init(
config, base::Bind(&SimpleHost::SetIT2MeAccessCode,
- base::Unretained(this),
- support_access_verifier.get()))) {
+ base::Unretained(this)))) {
return 1;
}
- access_verifier.reset(support_access_verifier.release());
- } else {
- scoped_ptr<remoting::SelfAccessVerifier> self_access_verifier(
- new remoting::SelfAccessVerifier());
- if (!self_access_verifier->Init(config))
- return 1;
- access_verifier.reset(self_access_verifier.release());
}
log_to_server.reset(new remoting::LogToServer(
context.network_message_loop()));
@@ -181,8 +169,8 @@ class SimpleHost {
desktop_environment.reset(DesktopEnvironment::Create(&context));
}
- host_ = ChromotingHost::Create(&context, config, desktop_environment.get(),
- access_verifier.release(), false);
+ host_ = ChromotingHost::Create(
+ &context, config, desktop_environment.get(), false);
host_->set_it2me(is_it2me_);
if (protocol_config_.get()) {
@@ -227,12 +215,11 @@ class SimpleHost {
private:
// TODO(wez): This only needs to be a member because it needs access to the
// ChromotingHost, which has to be created after the SupportAccessVerifier.
- void SetIT2MeAccessCode(remoting::SupportAccessVerifier* access_verifier,
- bool successful, const std::string& support_id,
+ void SetIT2MeAccessCode(bool successful, const std::string& support_id,
const base::TimeDelta& lifetime) {
- access_verifier->OnIT2MeHostRegistered(successful, support_id);
if (successful) {
- std::string access_code = support_id + access_verifier->host_secret();
+ std::string host_secret = remoting::GenerateSupportHostSecret();
+ std::string access_code = support_id + host_secret;
std::cout << "Support id: " << access_code << std::endl;
// Tell the ChromotingHost the access code, to use as shared-secret.
« no previous file with comments | « remoting/host/self_access_verifier_unittest.cc ('k') | remoting/host/support_access_verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698