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

Unified Diff: base/memory/ref_counted.cc

Issue 1087083002: [Not for review] scoped_refptr move benchmark. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « base/memory/ref_counted.h ('k') | base/memory/ref_counted_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/ref_counted.cc
diff --git a/base/memory/ref_counted.cc b/base/memory/ref_counted.cc
index f5924d0fe76e44672ca24372f93b40d418f46b62..679cbceab13b3a7faae2d86699d81c85b7649c4b 100644
--- a/base/memory/ref_counted.cc
+++ b/base/memory/ref_counted.cc
@@ -51,3 +51,15 @@ bool RefCountedThreadSafeBase::Release() const {
} // namespace subtle
} // namespace base
+
+scoped_refptr<ThreadUnsafe> get_thread_unsafe() {
+ static scoped_refptr<ThreadUnsafe>* g_thread_unsafe =
+ new scoped_refptr<ThreadUnsafe>(new ThreadUnsafe());
+ return *g_thread_unsafe;
+}
+
+scoped_refptr<ThreadSafe> get_thread_safe() {
+ static scoped_refptr<ThreadSafe>* g_thread_safe =
+ new scoped_refptr<ThreadSafe>(new ThreadSafe());
+ return *g_thread_safe;
+}
« no previous file with comments | « base/memory/ref_counted.h ('k') | base/memory/ref_counted_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698