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

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

Issue 2767193002: Postmortem report collection: validate internal state (Closed)
Patch Set: Compile fixup Created 3 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
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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 tracker->RecordFieldTrial(trial_name, group_name); 1015 tracker->RecordFieldTrial(trial_name, group_name);
1016 } 1016 }
1017 1017
1018 // Record exception information for the current thread. 1018 // Record exception information for the current thread.
1019 ALWAYS_INLINE 1019 ALWAYS_INLINE
1020 void RecordException(const void* origin, uint32_t code) { 1020 void RecordException(const void* origin, uint32_t code) {
1021 return RecordExceptionImpl(::tracked_objects::GetProgramCounter(), origin, 1021 return RecordExceptionImpl(::tracked_objects::GetProgramCounter(), origin,
1022 code); 1022 code);
1023 } 1023 }
1024 1024
1025 // Marks the tracked data as deleted.
1026 void MarkDeleted();
1027
1025 // Gets the process ID used for tracking. This is typically the same as what 1028 // Gets the process ID used for tracking. This is typically the same as what
1026 // the OS thinks is the current process but can be overridden for testing. 1029 // the OS thinks is the current process but can be overridden for testing.
1027 int64_t process_id() { return process_id_; }; 1030 int64_t process_id() { return process_id_; }
1028 1031
1029 // Accesses the process data record for storing arbitrary key/value pairs. 1032 // Accesses the process data record for storing arbitrary key/value pairs.
1030 // Updates to this are thread-safe. 1033 // Updates to this are thread-safe.
1031 ActivityUserData& process_data() { return process_data_; } 1034 ActivityUserData& process_data() { return process_data_; }
1032 1035
1033 private: 1036 private:
1034 friend class GlobalActivityAnalyzer; 1037 friend class GlobalActivityAnalyzer;
1035 friend class ScopedThreadActivity; 1038 friend class ScopedThreadActivity;
1036 friend class ActivityTrackerTest; 1039 friend class ActivityTrackerTest;
1037 1040
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 ScopedProcessWaitActivity(const void* program_counter, 1337 ScopedProcessWaitActivity(const void* program_counter,
1335 const base::Process* process); 1338 const base::Process* process);
1336 DISALLOW_COPY_AND_ASSIGN(ScopedProcessWaitActivity); 1339 DISALLOW_COPY_AND_ASSIGN(ScopedProcessWaitActivity);
1337 }; 1340 };
1338 #endif 1341 #endif
1339 1342
1340 } // namespace debug 1343 } // namespace debug
1341 } // namespace base 1344 } // namespace base
1342 1345
1343 #endif // BASE_DEBUG_ACTIVITY_TRACKER_H_ 1346 #endif // BASE_DEBUG_ACTIVITY_TRACKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698