Chromium Code Reviews| Index: chrome/browser/task_profiler/auto_tracking.h |
| diff --git a/chrome/browser/task_profiler/auto_tracking.h b/chrome/browser/task_profiler/auto_tracking.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0452c8455dbcde6a772cf9d2d239ee451cd0b954 |
| --- /dev/null |
| +++ b/chrome/browser/task_profiler/auto_tracking.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2011 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 CHROME_BROWSER_TASK_PROFILER_AUTO_TRACKING_H_ |
| +#define CHROME_BROWSER_TASK_PROFILER_AUTO_TRACKING_H_ |
| +#pragma once |
| + |
| +#include "base/tracked_objects.h" |
| +#include "base/file_path.h" |
|
jar (doing other things)
2012/02/08 20:34:37
nit: alphabetize
rlarocque
2012/02/08 23:49:44
Done.
|
| + |
| +//------------------------------------------------------------------------------ |
| +// Provide simple way to to start global tracking, and to tear down tracking |
| +// when done. The design has evolved to *not* do any teardown (and just leak |
| +// all allocated data structures). This class is currently used to ensure |
| +// that the profiler data is output during shutdown, if this feature has been |
| +// requested. |
| + |
| +namespace task_profiler { |
| + |
| +class AutoTracking { |
| + public: |
| + AutoTracking() { |
| + tracked_objects::ThreadData::Initialize(); |
| + } |
| + |
| + ~AutoTracking(); |
| + |
| + void set_output_file_path(const FilePath &path) { |
| + output_file_path_ = path; |
|
jar (doing other things)
2012/02/08 20:34:37
nit: move body of methods into auto_tracking.cc
rlarocque
2012/02/08 23:49:44
Done.
|
| + } |
| + |
| + private: |
| + FilePath output_file_path_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AutoTracking); |
| +}; |
| + |
| +} // namespace task_profiler |
| + |
| +#endif // CHROME_BROWSER_TASK_PROFILER_AUTO_TRACKING_H_ |