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

Unified Diff: remoting/host/remoting_me2me_host.cc

Issue 1838313002: Restart the host when the third party auth certificate changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix small typo Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/linux/certificate_watcher_unittest.cc ('k') | remoting/remoting_host_srcs.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 2460328157713065969fef344a444be07d218ae1..cd91f2b9d2da99d07ef7aad5872f4a1f8ed2b2b3 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -115,6 +115,7 @@
#undef Status // Xlib.h #defines this, which breaks protobuf headers.
#include <base/linux_util.h>
#include "remoting/host/audio_capturer_linux.h"
+#include "remoting/host/linux/certificate_watcher.h"
#endif // defined(OS_LINUX)
#if defined(OS_WIN)
@@ -390,6 +391,11 @@ class HostProcess : public ConfigWatcher::Delegate,
scoped_ptr<ChromotingHostContext> context_;
+#if defined(OS_LINUX)
+ // Watch for certificate changes and kill the host when changes occur
+ scoped_ptr<CertificateWatcher> cert_watcher_;
+#endif
+
// XMPP server/remoting bot configuration (initialized from the command line).
XmppSignalStrategy::XmppServerConfig xmpp_server_config_;
std::string directory_bot_jid_;
@@ -807,6 +813,16 @@ void HostProcess::CreateAuthenticatorFactory() {
DCHECK(third_party_auth_config_.token_url.is_valid());
DCHECK(third_party_auth_config_.token_validation_url.is_valid());
+#if defined(OS_LINUX)
+ if (!cert_watcher_) {
+ cert_watcher_.reset(new CertificateWatcher(
+ base::Bind(&HostProcess::ShutdownHost, this, kSuccessExitCode),
+ context_->file_task_runner()));
+ cert_watcher_->Start();
+ }
+ cert_watcher_->SetMonitor(host_->AsWeakPtr());
+#endif
+
scoped_refptr<protocol::TokenValidatorFactory> token_validator_factory =
new TokenValidatorFactoryImpl(third_party_auth_config_, key_pair_,
context_->url_request_context_getter());
« no previous file with comments | « remoting/host/linux/certificate_watcher_unittest.cc ('k') | remoting/remoting_host_srcs.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698