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

Unified Diff: ppapi/proxy/proxy_completion_callback_factory.h

Issue 2407393002: Remove MessageLoop::current() from ppapi/proxy. (Closed)
Patch Set: fix test error Created 4 years, 2 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 | « ppapi/proxy/plugin_globals.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/proxy_completion_callback_factory.h
diff --git a/ppapi/proxy/proxy_completion_callback_factory.h b/ppapi/proxy/proxy_completion_callback_factory.h
index 71322b0ad66526626006b80ad7f79fe1f9b6efee..4b8bafe676aab938dfb87268d43d4e856b9830af 100644
--- a/ppapi/proxy/proxy_completion_callback_factory.h
+++ b/ppapi/proxy/proxy_completion_callback_factory.h
@@ -8,7 +8,7 @@
#include <stdint.h>
#include "base/logging.h"
-#include "base/message_loop/message_loop.h"
+#include "base/sequence_checker.h"
#include "ppapi/cpp/completion_callback.h"
#include "ppapi/utility/completion_callback_factory.h"
@@ -21,38 +21,26 @@ class ProxyNonThreadSafeThreadTraits {
public:
class RefCount {
public:
- RefCount() : ref_(0) {
-#ifndef NDEBUG
- message_loop_ = base::MessageLoop::current();
-#endif
- }
+ RefCount() : ref_(0) {}
~RefCount() {
-#ifndef NDEBUG
- DCHECK(message_loop_ == base::MessageLoop::current());
-#endif
+ DCHECK(sequence_checker_.CalledOnValidSequence());
}
int32_t AddRef() {
-#ifndef NDEBUG
- DCHECK(message_loop_ == base::MessageLoop::current());
-#endif
+ DCHECK(sequence_checker_.CalledOnValidSequence());
return ++ref_;
}
int32_t Release() {
-#ifndef NDEBUG
- DCHECK(message_loop_ == base::MessageLoop::current());
-#endif
+ DCHECK(sequence_checker_.CalledOnValidSequence());
DCHECK(ref_ > 0);
return --ref_;
}
private:
int32_t ref_;
-#ifndef NDEBUG
- base::MessageLoop* message_loop_;
-#endif
+ base::SequenceChecker sequence_checker_;
};
// No-op lock class.
« no previous file with comments | « ppapi/proxy/plugin_globals.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698