Replace deprecated base::NonThreadSafe in chrome in favor of SequenceChecker.

https://codereview.chromium.org/2911983003
This commit is contained in:
Aleksei Kuzmin 2017-08-24 02:08:44 +03:00 committed by Cheng Zhao
parent 75b41102ef
commit ac8c205fd7
3 changed files with 6 additions and 2 deletions

View file

@ -18,7 +18,7 @@
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/process/process.h"
#include "base/threading/non_thread_safe.h"
#include "base/sequence_checker.h"
#include "ui/gfx/native_widget_types.h"
#if defined(OS_POSIX) && !defined(OS_ANDROID)
@ -44,7 +44,7 @@ class CommandLine;
// - the Windows implementation uses an invisible global message window;
// - the Linux implementation uses a Unix domain socket in the user data dir.
class ProcessSingleton : public base::NonThreadSafe {
class ProcessSingleton {
public:
enum NotifyResult {
PROCESS_NONE,
@ -179,6 +179,8 @@ class ProcessSingleton : public base::NonThreadSafe {
bool listen_on_ready_ = false;
#endif
SEQUENCE_CHECKER(sequence_checker_);
DISALLOW_COPY_AND_ASSIGN(ProcessSingleton);
};

View file

@ -733,6 +733,7 @@ ProcessSingleton::ProcessSingleton(
}
ProcessSingleton::~ProcessSingleton() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {

View file

@ -196,6 +196,7 @@ ProcessSingleton::ProcessSingleton(
}
ProcessSingleton::~ProcessSingleton() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (lock_file_ != INVALID_HANDLE_VALUE)
::CloseHandle(lock_file_);
}