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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/threading/thread_collision_warner.h" 6 #include "base/threading/thread_collision_warner.h"
7 7
8 namespace base { 8 namespace base {
9 9
10 namespace subtle { 10 namespace subtle {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 in_dtor_ = true; 44 in_dtor_ = true;
45 #endif 45 #endif
46 return true; 46 return true;
47 } 47 }
48 return false; 48 return false;
49 } 49 }
50 50
51 } // namespace subtle 51 } // namespace subtle
52 52
53 } // namespace base 53 } // namespace base
54
55 scoped_refptr<ThreadUnsafe> get_thread_unsafe() {
56 static scoped_refptr<ThreadUnsafe>* g_thread_unsafe =
57 new scoped_refptr<ThreadUnsafe>(new ThreadUnsafe());
58 return *g_thread_unsafe;
59 }
60
61 scoped_refptr<ThreadSafe> get_thread_safe() {
62 static scoped_refptr<ThreadSafe>* g_thread_safe =
63 new scoped_refptr<ThreadSafe>(new ThreadSafe());
64 return *g_thread_safe;
65 }
OLDNEW
« 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