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

Side by Side Diff: base/debug/activity_tracker.h

Issue 2688753002: Add acquire/release to global variable. (Closed)
Patch Set: rebased Created 3 years, 10 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 | « no previous file | base/debug/activity_tracker.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 // Activity tracking provides a low-overhead method of collecting information 5 // Activity tracking provides a low-overhead method of collecting information
6 // about the state of the application for analysis both while it is running 6 // about the state of the application for analysis both while it is running
7 // and after it has terminated unexpectedly. Its primary purpose is to help 7 // and after it has terminated unexpectedly. Its primary purpose is to help
8 // locate reasons the browser becomes unresponsive by providing insight into 8 // locate reasons the browser becomes unresponsive by providing insight into
9 // what all the various threads and processes are (or were) doing. 9 // what all the various threads and processes are (or were) doing.
10 10
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 // Like above but internally creates an allocator using local heap memory of 741 // Like above but internally creates an allocator using local heap memory of
742 // the specified size. This is used primarily for unit tests. 742 // the specified size. This is used primarily for unit tests.
743 static void CreateWithLocalMemory(size_t size, 743 static void CreateWithLocalMemory(size_t size,
744 uint64_t id, 744 uint64_t id,
745 StringPiece name, 745 StringPiece name,
746 int stack_depth); 746 int stack_depth);
747 747
748 // Gets the global activity-tracker or null if none exists. 748 // Gets the global activity-tracker or null if none exists.
749 static GlobalActivityTracker* Get() { 749 static GlobalActivityTracker* Get() {
750 return reinterpret_cast<GlobalActivityTracker*>( 750 return reinterpret_cast<GlobalActivityTracker*>(
751 subtle::NoBarrier_Load(&g_tracker_)); 751 subtle::Acquire_Load(&g_tracker_));
752 } 752 }
753 753
754 // Gets the persistent-memory-allocator in which data is stored. Callers 754 // Gets the persistent-memory-allocator in which data is stored. Callers
755 // can store additional records here to pass more information to the 755 // can store additional records here to pass more information to the
756 // analysis process. 756 // analysis process.
757 PersistentMemoryAllocator* allocator() { return allocator_.get(); } 757 PersistentMemoryAllocator* allocator() { return allocator_.get(); }
758 758
759 // Gets the thread's activity-tracker if it exists. This is inline for 759 // Gets the thread's activity-tracker if it exists. This is inline for
760 // performance reasons and it uses thread-local-storage (TLS) so that there 760 // performance reasons and it uses thread-local-storage (TLS) so that there
761 // is no significant lookup time required to find the one for the calling 761 // is no significant lookup time required to find the one for the calling
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 ScopedProcessWaitActivity(const void* program_counter, 1068 ScopedProcessWaitActivity(const void* program_counter,
1069 const base::Process* process); 1069 const base::Process* process);
1070 DISALLOW_COPY_AND_ASSIGN(ScopedProcessWaitActivity); 1070 DISALLOW_COPY_AND_ASSIGN(ScopedProcessWaitActivity);
1071 }; 1071 };
1072 #endif 1072 #endif
1073 1073
1074 } // namespace debug 1074 } // namespace debug
1075 } // namespace base 1075 } // namespace base
1076 1076
1077 #endif // BASE_DEBUG_ACTIVITY_TRACKER_H_ 1077 #endif // BASE_DEBUG_ACTIVITY_TRACKER_H_
OLDNEW
« no previous file with comments | « no previous file | base/debug/activity_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698