Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_TASK_PROFILER_AUTO_TRACKING_H_ | |
| 6 #define CHROME_BROWSER_TASK_PROFILER_AUTO_TRACKING_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/tracked_objects.h" | |
| 10 #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.
| |
| 11 | |
| 12 //------------------------------------------------------------------------------ | |
| 13 // Provide simple way to to start global tracking, and to tear down tracking | |
| 14 // when done. The design has evolved to *not* do any teardown (and just leak | |
| 15 // all allocated data structures). This class is currently used to ensure | |
| 16 // that the profiler data is output during shutdown, if this feature has been | |
| 17 // requested. | |
| 18 | |
| 19 namespace task_profiler { | |
| 20 | |
| 21 class AutoTracking { | |
| 22 public: | |
| 23 AutoTracking() { | |
| 24 tracked_objects::ThreadData::Initialize(); | |
| 25 } | |
| 26 | |
| 27 ~AutoTracking(); | |
| 28 | |
| 29 void set_output_file_path(const FilePath &path) { | |
| 30 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.
| |
| 31 } | |
| 32 | |
| 33 private: | |
| 34 FilePath output_file_path_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(AutoTracking); | |
| 37 }; | |
| 38 | |
| 39 } // namespace task_profiler | |
| 40 | |
| 41 #endif // CHROME_BROWSER_TASK_PROFILER_AUTO_TRACKING_H_ | |
| OLD | NEW |