Commit c342ef57 authored by tzik's avatar tzik Committed by Commit Bot

Make base::{Thread,Sequence}CheckerDoNothing noncopyable

This CL makes base::{Thread,Sequence}CheckerDoNothing noncopyable, so
that they are consistent to base::{Thread,Sequence}CheckerImpl, and an
accidental copy of SequenceChecker causes a compile error even on
DCHCEK-disabled build.

Change-Id: I3ac37d87302712ab3decf693d056376c0c2abb91
Reviewed-on: https://chromium-review.googlesource.com/578751
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488614}
parent e19e177e
...@@ -67,9 +67,12 @@ namespace base { ...@@ -67,9 +67,12 @@ namespace base {
// above macros) to get the right version for your build configuration. // above macros) to get the right version for your build configuration.
class SequenceCheckerDoNothing { class SequenceCheckerDoNothing {
public: public:
SequenceCheckerDoNothing() = default;
bool CalledOnValidSequence() const WARN_UNUSED_RESULT { return true; } bool CalledOnValidSequence() const WARN_UNUSED_RESULT { return true; }
void DetachFromSequence() {} void DetachFromSequence() {}
private:
DISALLOW_COPY_AND_ASSIGN(SequenceCheckerDoNothing);
}; };
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
......
...@@ -78,11 +78,12 @@ namespace base { ...@@ -78,11 +78,12 @@ namespace base {
// macros) to get the right version for your build configuration. // macros) to get the right version for your build configuration.
class ThreadCheckerDoNothing { class ThreadCheckerDoNothing {
public: public:
bool CalledOnValidThread() const WARN_UNUSED_RESULT { ThreadCheckerDoNothing() = default;
return true; bool CalledOnValidThread() const WARN_UNUSED_RESULT { return true; }
}
void DetachFromThread() {} void DetachFromThread() {}
private:
DISALLOW_COPY_AND_ASSIGN(ThreadCheckerDoNothing);
}; };
// Note that ThreadCheckerImpl::CalledOnValidThread() returns false when called // Note that ThreadCheckerImpl::CalledOnValidThread() returns false when called
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment