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

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

Issue 600213002: Instrumenting OnExtensionAddListener observer invocation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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
« no previous file with comments | « no previous file | extensions/browser/event_router.cc » ('j') | extensions/browser/event_router.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 #ifndef BASE_PROFILER_SCOPED_PROFILE_H_ 6 #ifndef BASE_PROFILER_SCOPED_PROFILE_H_
7 #define BASE_PROFILER_SCOPED_PROFILE_H_ 7 #define BASE_PROFILER_SCOPED_PROFILE_H_
8 8
9 //------------------------------------------------------------------------------ 9 //------------------------------------------------------------------------------
10 // ScopedProfile provides basic helper functions for profiling a short 10 // ScopedProfile provides basic helper functions for profiling a short
(...skipping 26 matching lines...) Expand all
37 37
38 #define PASTE_LINE_NUMBER_ON_NAME(name, line) name##line 38 #define PASTE_LINE_NUMBER_ON_NAME(name, line) name##line
39 39
40 #define LINE_BASED_VARIABLE_NAME_FOR_PROFILING \ 40 #define LINE_BASED_VARIABLE_NAME_FOR_PROFILING \
41 PASTE_LINE_NUMBER_ON_NAME(some_profiler_variable_, __LINE__) 41 PASTE_LINE_NUMBER_ON_NAME(some_profiler_variable_, __LINE__)
42 42
43 #define TRACK_RUN_IN_IPC_HANDLER(dispatch_function_name) \ 43 #define TRACK_RUN_IN_IPC_HANDLER(dispatch_function_name) \
44 ::tracked_objects::ScopedProfile some_tracking_variable_name( \ 44 ::tracked_objects::ScopedProfile some_tracking_variable_name( \
45 FROM_HERE_WITH_EXPLICIT_FUNCTION(#dispatch_function_name)) 45 FROM_HERE_WITH_EXPLICIT_FUNCTION(#dispatch_function_name))
46 46
47 // Profiled region for developer and official builds. It allows developers to do
48 // profiling of their code, and see results on their about:profiler page and in
49 // Google-internal server-side tools.
50 #define TRACK_RUN_IN_THIS_SCOPED_REGION(scope_name) \
51 TRACK_RUN_IN_IPC_HANDLER(scope_name)
Ilya Sherman 2014/09/24 23:38:01 It looks like all of the macros in this file could
vadimt 2014/09/25 00:21:21 Done.
52
47 53
48 namespace tracked_objects { 54 namespace tracked_objects {
49 class Births; 55 class Births;
50 56
51 class BASE_EXPORT ScopedProfile { 57 class BASE_EXPORT ScopedProfile {
52 public: 58 public:
53 explicit ScopedProfile(const Location& location); 59 explicit ScopedProfile(const Location& location);
54 ~ScopedProfile(); 60 ~ScopedProfile();
55 61
56 // Stop tracing prior to the end destruction of the instance. 62 // Stop tracing prior to the end destruction of the instance.
57 void StopClockAndTally(); 63 void StopClockAndTally();
58 64
59 private: 65 private:
60 Births* birth_; // Place in code where tracking started. 66 Births* birth_; // Place in code where tracking started.
61 TaskStopwatch stopwatch_; 67 TaskStopwatch stopwatch_;
62 68
63 DISALLOW_COPY_AND_ASSIGN(ScopedProfile); 69 DISALLOW_COPY_AND_ASSIGN(ScopedProfile);
64 }; 70 };
65 71
66 } // namespace tracked_objects 72 } // namespace tracked_objects
67 73
68 #endif // BASE_PROFILER_SCOPED_PROFILE_H_ 74 #endif // BASE_PROFILER_SCOPED_PROFILE_H_
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/event_router.cc » ('j') | extensions/browser/event_router.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698