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

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

Issue 2467103002: Collect an initial set of stability activities (Closed)
Patch Set: Address clang warnings Created 4 years, 1 month 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 | components/browser_watcher/postmortem_report_collector.h » ('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 #ifndef BASE_DEBUG_ACTIVITY_ANALYZER_H_ 5 #ifndef BASE_DEBUG_ACTIVITY_ANALYZER_H_
6 #define BASE_DEBUG_ACTIVITY_ANALYZER_H_ 6 #define BASE_DEBUG_ACTIVITY_ANALYZER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
11 #include <string>
11 12
12 #include "base/base_export.h" 13 #include "base/base_export.h"
13 #include "base/debug/activity_tracker.h" 14 #include "base/debug/activity_tracker.h"
14 15
15 namespace base { 16 namespace base {
16 namespace debug { 17 namespace debug {
17 18
18 // This class provides analysis of data captured from a ThreadActivityTracker. 19 // This class provides analysis of data captured from a ThreadActivityTracker.
19 // When created, it takes a snapshot of the data held by the tracker and 20 // When created, it takes a snapshot of the data held by the tracker and
20 // makes that information available to other code. 21 // makes that information available to other code.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 const std::string& GetThreadName() { 67 const std::string& GetThreadName() {
67 return activity_snapshot_.thread_name; 68 return activity_snapshot_.thread_name;
68 } 69 }
69 70
70 // Gets the TheadKey for this thread. 71 // Gets the TheadKey for this thread.
71 ThreadKey GetThreadKey() { 72 ThreadKey GetThreadKey() {
72 return ThreadKey(activity_snapshot_.process_id, 73 return ThreadKey(activity_snapshot_.process_id,
73 activity_snapshot_.thread_id); 74 activity_snapshot_.thread_id);
74 } 75 }
75 76
77 const ActivitySnapshot& activity_snapshot() { return activity_snapshot_; }
78
76 private: 79 private:
77 friend class GlobalActivityAnalyzer; 80 friend class GlobalActivityAnalyzer;
78 81
79 // The snapshot of the activity tracker taken at the moment of construction. 82 // The snapshot of the activity tracker taken at the moment of construction.
80 ActivitySnapshot activity_snapshot_; 83 ActivitySnapshot activity_snapshot_;
81 84
82 // Flag indicating if the snapshot data is valid. 85 // Flag indicating if the snapshot data is valid.
83 bool activity_snapshot_valid_; 86 bool activity_snapshot_valid_;
84 87
85 // A reference into a persistent memory allocator, used by the global 88 // A reference into a persistent memory allocator, used by the global
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // first/next iteration. 150 // first/next iteration.
148 AnalyzerMap::iterator analyzers_iterator_; 151 AnalyzerMap::iterator analyzers_iterator_;
149 152
150 DISALLOW_COPY_AND_ASSIGN(GlobalActivityAnalyzer); 153 DISALLOW_COPY_AND_ASSIGN(GlobalActivityAnalyzer);
151 }; 154 };
152 155
153 } // namespace debug 156 } // namespace debug
154 } // namespace base 157 } // namespace base
155 158
156 #endif // BASE_DEBUG_ACTIVITY_ANALYZER_H_ 159 #endif // BASE_DEBUG_ACTIVITY_ANALYZER_H_
OLDNEW
« no previous file with comments | « no previous file | components/browser_watcher/postmortem_report_collector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698