diff options
author | avi <avi@chromium.org> | 2015-12-26 14:15:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-26 22:16:15 +0000 |
commit | 9b6f42934e5a1e65ebfc668d91a28a6e2678a14c (patch) | |
tree | 6fb35dc2e15b6aeb7ce5d8fb2daf08f58c6d77e7 /base/tracked_objects.h | |
parent | 28523e2cf18ee02f503e1792788b88d828968055 (diff) | |
download | chromium_src-9b6f42934e5a1e65ebfc668d91a28a6e2678a14c.zip chromium_src-9b6f42934e5a1e65ebfc668d91a28a6e2678a14c.tar.gz chromium_src-9b6f42934e5a1e65ebfc668d91a28a6e2678a14c.tar.bz2 |
Switch to standard integer types in base/.
BUG=138542
TBR=mark@chromium.org
NOPRESUBMIT=true
Review URL: https://codereview.chromium.org/1538743002
Cr-Commit-Position: refs/heads/master@{#366910}
Diffstat (limited to 'base/tracked_objects.h')
-rw-r--r-- | base/tracked_objects.h | 80 |
1 files changed, 41 insertions, 39 deletions
diff --git a/base/tracked_objects.h b/base/tracked_objects.h index e62948d8..ef43fe7 100644 --- a/base/tracked_objects.h +++ b/base/tracked_objects.h @@ -5,6 +5,8 @@ #ifndef BASE_TRACKED_OBJECTS_H_ #define BASE_TRACKED_OBJECTS_H_ +#include <stdint.h> + #include <map> #include <set> #include <stack> @@ -14,11 +16,11 @@ #include "base/atomicops.h" #include "base/base_export.h" -#include "base/basictypes.h" #include "base/containers/hash_tables.h" #include "base/gtest_prod_util.h" #include "base/lazy_instance.h" #include "base/location.h" +#include "base/macros.h" #include "base/process/process_handle.h" #include "base/profiler/alternate_timer.h" #include "base/profiler/tracked_time.h" @@ -259,12 +261,12 @@ struct BASE_EXPORT DeathDataSnapshot { // a wrapper structure as a param or using an empty constructor for // snapshotting DeathData would be less efficient. DeathDataSnapshot(int count, - int32 run_duration_sum, - int32 run_duration_max, - int32 run_duration_sample, - int32 queue_duration_sum, - int32 queue_duration_max, - int32 queue_duration_sample); + int32_t run_duration_sum, + int32_t run_duration_max, + int32_t run_duration_sample, + int32_t queue_duration_sum, + int32_t queue_duration_max, + int32_t queue_duration_sample); ~DeathDataSnapshot(); // Calculates and returns the delta between this snapshot and an earlier @@ -272,12 +274,12 @@ struct BASE_EXPORT DeathDataSnapshot { DeathDataSnapshot Delta(const DeathDataSnapshot& older) const; int count; - int32 run_duration_sum; - int32 run_duration_max; - int32 run_duration_sample; - int32 queue_duration_sum; - int32 queue_duration_max; - int32 queue_duration_sample; + int32_t run_duration_sum; + int32_t run_duration_max; + int32_t run_duration_sample; + int32_t queue_duration_sum; + int32_t queue_duration_max; + int32_t queue_duration_sample; }; //------------------------------------------------------------------------------ @@ -287,12 +289,12 @@ struct BASE_EXPORT DeathDataSnapshot { struct DeathDataPhaseSnapshot { DeathDataPhaseSnapshot(int profiling_phase, int count, - int32 run_duration_sum, - int32 run_duration_max, - int32 run_duration_sample, - int32 queue_duration_sum, - int32 queue_duration_max, - int32 queue_duration_sample, + int32_t run_duration_sum, + int32_t run_duration_max, + int32_t run_duration_sample, + int32_t queue_duration_sum, + int32_t queue_duration_max, + int32_t queue_duration_sample, const DeathDataPhaseSnapshot* prev); // Profiling phase at which completion this snapshot was taken. @@ -325,19 +327,19 @@ class BASE_EXPORT DeathData { // Update stats for a task destruction (death) that had a Run() time of // |duration|, and has had a queueing delay of |queue_duration|. - void RecordDeath(const int32 queue_duration, - const int32 run_duration, - const uint32 random_number); + void RecordDeath(const int32_t queue_duration, + const int32_t run_duration, + const uint32_t random_number); // Metrics and past snapshots accessors, used only for serialization and in // tests. int count() const { return count_; } - int32 run_duration_sum() const { return run_duration_sum_; } - int32 run_duration_max() const { return run_duration_max_; } - int32 run_duration_sample() const { return run_duration_sample_; } - int32 queue_duration_sum() const { return queue_duration_sum_; } - int32 queue_duration_max() const { return queue_duration_max_; } - int32 queue_duration_sample() const { return queue_duration_sample_; } + int32_t run_duration_sum() const { return run_duration_sum_; } + int32_t run_duration_max() const { return run_duration_max_; } + int32_t run_duration_sample() const { return run_duration_sample_; } + int32_t queue_duration_sum() const { return queue_duration_sum_; } + int32_t queue_duration_max() const { return queue_duration_max_; } + int32_t queue_duration_sample() const { return queue_duration_sample_; } const DeathDataPhaseSnapshot* last_phase_snapshot() const { return last_phase_snapshot_; } @@ -362,18 +364,18 @@ class BASE_EXPORT DeathData { // Basic tallies, used to compute averages. Can be incremented only on the // death thread. - int32 run_duration_sum_; - int32 queue_duration_sum_; + int32_t run_duration_sum_; + int32_t queue_duration_sum_; // Max values, used by local visualization routines. These are often read, // but rarely updated. The max values get assigned only on the death thread, // but these fields can be set to 0 by OnProfilingPhaseCompleted() on the // snapshot thread. - int32 run_duration_max_; - int32 queue_duration_max_; + int32_t run_duration_max_; + int32_t queue_duration_max_; // Samples, used by crowd sourcing gatherers. These are almost never read, // and rarely updated. They can be modified only on the death thread. - int32 run_duration_sample_; - int32 queue_duration_sample_; + int32_t run_duration_sample_; + int32_t queue_duration_sample_; // Snapshot of this death data made at the last profiling phase completion, if // any. DeathData owns the whole list starting with this pointer. @@ -575,7 +577,7 @@ class BASE_EXPORT ThreadData { // Find a place to record a death on this thread. void TallyADeath(const Births& births, - int32 queue_duration, + int32_t queue_duration, const TaskStopwatch& stopwatch); // Snapshots (under a lock) the profiled data for the tasks for this thread @@ -708,7 +710,7 @@ class BASE_EXPORT ThreadData { // representative sample in each DeathData instance. We can't start off with // much randomness (because we can't call RandInt() on all our threads), so // we stir in more and more as we go. - uint32 random_number_; + uint32_t random_number_; // Record of what the incarnation_counter_ was when this instance was created. // If the incarnation_counter_ has changed, then we avoid pushing into the @@ -748,7 +750,7 @@ class BASE_EXPORT TaskStopwatch { // and stopping this stopwatch, minus the wallclock durations of any other // instances that are immediately nested in this one, started and stopped on // this thread during that period. - int32 RunDurationMs() const; + int32_t RunDurationMs() const; // Returns tracking info for the current thread. ThreadData* GetThreadData() const; @@ -758,14 +760,14 @@ class BASE_EXPORT TaskStopwatch { TrackedTime start_time_; // Wallclock duration of the task. - int32 wallclock_duration_ms_; + int32_t wallclock_duration_ms_; // Tracking info for the current thread. ThreadData* current_thread_data_; // Sum of wallclock durations of all stopwatches that were directly nested in // this one. - int32 excluded_duration_ms_; + int32_t excluded_duration_ms_; // Stopwatch which was running on our thread when this stopwatch was started. // That preexisting stopwatch must be adjusted to the exclude the wallclock |