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

Unified Diff: components/login/screens/screen_context.h

Issue 2910073003: Replace deprecated base::NonThreadSafe in components/login in favor of SequenceChecker. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | components/login/screens/screen_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/login/screens/screen_context.h
diff --git a/components/login/screens/screen_context.h b/components/login/screens/screen_context.h
index 665f79894e6b1b2908ae772dc6ccc702e9de851b..03fc037ae71356be06a9776f80fd4eec25314c68 100644
--- a/components/login/screens/screen_context.h
+++ b/components/login/screens/screen_context.h
@@ -10,8 +10,8 @@
#include "base/logging.h"
#include "base/macros.h"
+#include "base/sequence_checker.h"
#include "base/strings/string16.h"
-#include "base/threading/non_thread_safe.h"
#include "base/values.h"
#include "components/login/base_screen_handler_utils.h"
#include "components/login/login_export.h"
@@ -31,7 +31,7 @@ namespace login {
// ScreenContext memorizes changed key-value pairs and returns them
// via GetChangesAndReset() method. After call to this method an
// internal buffer of changes will be cleared.
-class LOGIN_EXPORT ScreenContext : public base::NonThreadSafe {
+class LOGIN_EXPORT ScreenContext {
public:
typedef std::string KeyType;
typedef base::Value ValueType;
@@ -94,7 +94,7 @@ class LOGIN_EXPORT ScreenContext : public base::NonThreadSafe {
template <typename T>
T Get(const KeyType& key) const {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
const base::Value* value;
bool has_key = storage_.Get(key, &value);
DCHECK(has_key);
@@ -108,7 +108,7 @@ class LOGIN_EXPORT ScreenContext : public base::NonThreadSafe {
template <typename T>
T Get(const KeyType& key, const T& default_value) const {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!HasKey(key))
return default_value;
return Get<T>(key);
@@ -120,6 +120,8 @@ class LOGIN_EXPORT ScreenContext : public base::NonThreadSafe {
// Contains all pending changes.
base::DictionaryValue changes_;
+ SEQUENCE_CHECKER(sequence_checker_);
+
DISALLOW_COPY_AND_ASSIGN(ScreenContext);
};
« no previous file with comments | « no previous file | components/login/screens/screen_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698