Replace deprecated base::NonThreadSafe in chrome in favor of SequenceChecker.
https://codereview.chromium.org/2911983003
This commit is contained in:
parent
75b41102ef
commit
ac8c205fd7
3 changed files with 6 additions and 2 deletions
|
@ -18,7 +18,7 @@
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/memory/ref_counted.h"
|
#include "base/memory/ref_counted.h"
|
||||||
#include "base/process/process.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"
|
#include "ui/gfx/native_widget_types.h"
|
||||||
|
|
||||||
#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
#if defined(OS_POSIX) && !defined(OS_ANDROID)
|
||||||
|
@ -44,7 +44,7 @@ class CommandLine;
|
||||||
// - the Windows implementation uses an invisible global message window;
|
// - the Windows implementation uses an invisible global message window;
|
||||||
// - the Linux implementation uses a Unix domain socket in the user data dir.
|
// - the Linux implementation uses a Unix domain socket in the user data dir.
|
||||||
|
|
||||||
class ProcessSingleton : public base::NonThreadSafe {
|
class ProcessSingleton {
|
||||||
public:
|
public:
|
||||||
enum NotifyResult {
|
enum NotifyResult {
|
||||||
PROCESS_NONE,
|
PROCESS_NONE,
|
||||||
|
@ -179,6 +179,8 @@ class ProcessSingleton : public base::NonThreadSafe {
|
||||||
bool listen_on_ready_ = false;
|
bool listen_on_ready_ = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
SEQUENCE_CHECKER(sequence_checker_);
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ProcessSingleton);
|
DISALLOW_COPY_AND_ASSIGN(ProcessSingleton);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -733,6 +733,7 @@ ProcessSingleton::ProcessSingleton(
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessSingleton::~ProcessSingleton() {
|
ProcessSingleton::~ProcessSingleton() {
|
||||||
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
|
ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
|
||||||
|
|
|
@ -196,6 +196,7 @@ ProcessSingleton::ProcessSingleton(
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessSingleton::~ProcessSingleton() {
|
ProcessSingleton::~ProcessSingleton() {
|
||||||
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||||
if (lock_file_ != INVALID_HANDLE_VALUE)
|
if (lock_file_ != INVALID_HANDLE_VALUE)
|
||||||
::CloseHandle(lock_file_);
|
::CloseHandle(lock_file_);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue