1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/sandbox/chromium/base/tracking_info.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +// Copyright (c) 2012 The Chromium Authors. All rights reserved. 1.5 +// Use of this source code is governed by a BSD-style license that can be 1.6 +// found in the LICENSE file. 1.7 + 1.8 +// This is a simple struct with tracking information that is stored 1.9 +// with a PendingTask (when message_loop is handling the task). 1.10 +// Only the information that is shared with the profiler in tracked_objects 1.11 +// are included in this structure. 1.12 + 1.13 + 1.14 +#ifndef BASE_TRACKING_INFO_H_ 1.15 +#define BASE_TRACKING_INFO_H_ 1.16 + 1.17 +#include "base/base_export.h" 1.18 +#include "base/profiler/tracked_time.h" 1.19 +#include "base/time/time.h" 1.20 + 1.21 +namespace tracked_objects { 1.22 +class Location; 1.23 +class Births; 1.24 +} 1.25 + 1.26 +namespace base { 1.27 + 1.28 +// This structure is copied around by value. 1.29 +struct BASE_EXPORT TrackingInfo { 1.30 + TrackingInfo(); 1.31 + TrackingInfo(const tracked_objects::Location& posted_from, 1.32 + base::TimeTicks delayed_run_time); 1.33 + ~TrackingInfo(); 1.34 + 1.35 + // To avoid conflating our stats with the delay duration in a PostDelayedTask, 1.36 + // we identify such tasks, and replace their post_time with the time they 1.37 + // were scheduled (requested?) to emerge from the delayed task queue. This 1.38 + // means that queuing delay for such tasks will show how long they went 1.39 + // unserviced, after they *could* be serviced. This is the same stat as we 1.40 + // have for non-delayed tasks, and we consistently call it queuing delay. 1.41 + tracked_objects::TrackedTime EffectiveTimePosted() const { 1.42 + return tracked_objects::TrackedTime( 1.43 + delayed_run_time.is_null() ? time_posted : delayed_run_time); 1.44 + } 1.45 + 1.46 + // Record of location and thread that the task came from. 1.47 + tracked_objects::Births* birth_tally; 1.48 + 1.49 + // Time when the related task was posted. 1.50 + base::TimeTicks time_posted; 1.51 + 1.52 + // The time when the task should be run. 1.53 + base::TimeTicks delayed_run_time; 1.54 +}; 1.55 + 1.56 +} // namespace base 1.57 + 1.58 +#endif // BASE_TRACKING_INFO_H_