| Index: cc/scheduler/begin_frame_tracker.h
|
| diff --git a/cc/scheduler/begin_frame_tracker.h b/cc/scheduler/begin_frame_tracker.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..57570cfa74eacbee2fa1aa6ad4344349c7ba83c2
|
| --- /dev/null
|
| +++ b/cc/scheduler/begin_frame_tracker.h
|
| @@ -0,0 +1,45 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_
|
| +#define CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_
|
| +
|
| +#include <set>
|
| +#include <string>
|
| +
|
| +#include "base/debug/trace_event.h"
|
| +#include "base/location.h"
|
| +#include "cc/output/begin_frame_args.h"
|
| +
|
| +#define BEGINFRAMETRACKER_FROM_HERE FROM_HERE_WITH_EXPLICIT_FUNCTION("")
|
| +
|
| +namespace cc {
|
| +
|
| +// Microclass to trace and check properties for correct BeginFrameArgs usage.
|
| +// TODO(mithro): Record stats about the BeginFrameArgs
|
| +class CC_EXPORT BeginFrameTracker {
|
| + public:
|
| + explicit BeginFrameTracker(const tracked_objects::Location& location);
|
| + ~BeginFrameTracker();
|
| +
|
| + void Start(BeginFrameArgs new_args);
|
| + const BeginFrameArgs& Get() const;
|
| + bool HasFinished() const { return !current_finished_at_.is_null(); }
|
| + void Finish();
|
| + const BeginFrameArgs& Last() const;
|
| +
|
| + base::TimeDelta Interval() const;
|
| +
|
| + private:
|
| + const tracked_objects::Location location_;
|
| + const std::string location_string_;
|
| +
|
| + base::TimeTicks current_updated_at_;
|
| + BeginFrameArgs current_args_;
|
| + base::TimeTicks current_finished_at_;
|
| +};
|
| +
|
| +} // namespace cc
|
| +
|
| +#endif // CC_SCHEDULER_BEGIN_FRAME_TRACKER_H_
|
|
|