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

Unified Diff: ppapi/proxy/proxy_non_thread_safe_ref_count.h

Issue 10696157: Add support for threadsafe completion callback factory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
Index: ppapi/proxy/proxy_non_thread_safe_ref_count.h
diff --git a/ppapi/proxy/proxy_non_thread_safe_ref_count.h b/ppapi/proxy/proxy_non_thread_safe_ref_count.h
deleted file mode 100644
index 855c87c6db0e795318c7d23aedac62838df66549..0000000000000000000000000000000000000000
--- a/ppapi/proxy/proxy_non_thread_safe_ref_count.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef PPAPI_PROXY_PROXY_NON_THREAD_SAFE_REF_COUNT_H_
-#define PPAPI_PROXY_PROXY_NON_THREAD_SAFE_REF_COUNT_H_
-
-#include "base/message_loop.h"
-#include "ppapi/cpp/completion_callback.h"
-
-namespace ppapi {
-namespace proxy {
-
-// This class is just like ppapi/cpp/non_thread_safe_ref_count.h but rather
-// than using pp::Module::core (which doesn't exist), it uses Chrome threads
-// which do.
-class ProxyNonThreadSafeRefCount {
- public:
- ProxyNonThreadSafeRefCount() : ref_(0) {
-#ifndef NDEBUG
- message_loop_ = MessageLoop::current();
-#endif
- }
-
- ~ProxyNonThreadSafeRefCount() {
- PP_DCHECK(message_loop_ == MessageLoop::current());
- }
-
- int32_t AddRef() {
- PP_DCHECK(message_loop_ == MessageLoop::current());
- return ++ref_;
- }
-
- int32_t Release() {
- PP_DCHECK(message_loop_ == MessageLoop::current());
- return --ref_;
- }
-
- private:
- int32_t ref_;
-#ifndef NDEBUG
- MessageLoop* message_loop_;
-#endif
-};
-
-} // namespace proxy
-} // namespace ppapi
-
-#endif // PPAPI_PROXY_PROXY_NON_THREAD_SAFE_REF_COUNT_H_

Powered by Google App Engine
This is Rietveld 408576698