#include "remoting/host/linux/certificate_watcher.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/hash/hash.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread_checker.h"
namespace remoting {
namespace {
const int kReadDelayInSeconds = …;
const char kCertDirectoryPath[] = …;
const char* const kCertFiles[] = …;
}
class CertDbContentWatcher { … };
CertDbContentWatcher::CertDbContentWatcher(
base::WeakPtr<CertificateWatcher> watcher,
scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
base::FilePath cert_watch_path,
base::TimeDelta read_delay)
: … { … }
CertDbContentWatcher::~CertDbContentWatcher() { … }
void CertDbContentWatcher::StartWatching() { … }
void CertDbContentWatcher::OnCertDirectoryChanged(const base::FilePath& path,
bool error) { … }
void CertDbContentWatcher::OnTimer() { … }
CertDbContentWatcher::HashValue CertDbContentWatcher::ComputeHash() { … }
CertificateWatcher::CertificateWatcher(
const base::RepeatingClosure& restart_action,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner)
: … { … }
CertificateWatcher::~CertificateWatcher() { … }
void CertificateWatcher::Start() { … }
void CertificateWatcher::SetMonitor(scoped_refptr<HostStatusMonitor> monitor) { … }
void CertificateWatcher::OnClientConnected(const std::string& jid) { … }
void CertificateWatcher::OnClientDisconnected(const std::string& jid) { … }
void CertificateWatcher::SetDelayForTests(const base::TimeDelta& delay) { … }
void CertificateWatcher::SetWatchPathForTests(
const base::FilePath& watch_path) { … }
bool CertificateWatcher::is_started() const { … }
void CertificateWatcher::DatabaseChanged() { … }
}