Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: base/profiler/scoped_profile.h

Issue 8496008: Revert 108752 - Support tracking of IPC messages as tasks in profiler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/location.h ('k') | base/profiler/scoped_profile.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
6 #ifndef BASE_PROFILER_SCOPED_PROFILE_H_
7 #define BASE_PROFILER_SCOPED_PROFILE_H_
8
9 //------------------------------------------------------------------------------
10 // ScopedProfile provides basic helper functions for profiling a short
11 // region of code within a scope. It is separate from the related ThreadData
12 // class so that it can be included without much other cruft, and provide the
13 // macros listed below.
14
15 #include "base/base_export.h"
16 #include "base/location.h"
17 #include "base/profiler/tracked_time.h"
18
19 #define TRACK_RUN_IN_THIS_SCOPED_REGION_FOR_OFFICIAL_BUILDS(variable_name) \
20 ::tracked_objects::ScopedProfile variable_name(FROM_HERE)
21
22 #define TRACK_RUN_IN_IPC_HANDLER(dispatch_function_name) \
23 ::tracked_objects::ScopedProfile some_tracking_variable_name( \
24 FROM_HERE_WITH_EXPLICIT_FUNCTION(#dispatch_function_name))
25
26
27 namespace tracked_objects {
28 class Births;
29
30 class BASE_EXPORT ScopedProfile {
31 public:
32 explicit ScopedProfile(const Location& location);
33 ~ScopedProfile();
34
35 // Stop tracing prior to the end destruction of the instance.
36 void StopClockAndTally();
37
38 private:
39 Births* birth_; // Place in code where tracking started.
40 const TrackedTime start_of_run_;
41
42 DISALLOW_COPY_AND_ASSIGN(ScopedProfile);
43 };
44
45 } // namespace tracked_objects
46
47 #endif // BASE_PROFILER_SCOPED_PROFILE_H_
OLDNEW
« no previous file with comments | « base/location.h ('k') | base/profiler/scoped_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698