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

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

Issue 1345433002: Add RTC_ prefix to contructormagic macros. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Formatting fix. Created 5 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 | « webrtc/base/opensslidentity.h ('k') | webrtc/base/proxyserver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2013 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 bool Clear(); 127 bool Clear();
128 128
129 static Profiler* Instance(); 129 static Profiler* Instance();
130 private: 130 private:
131 Profiler(); 131 Profiler();
132 132
133 typedef std::map<std::string, ProfilerEvent> EventMap; 133 typedef std::map<std::string, ProfilerEvent> EventMap;
134 EventMap events_; 134 EventMap events_;
135 mutable SharedExclusiveLock lock_; 135 mutable SharedExclusiveLock lock_;
136 136
137 DISALLOW_COPY_AND_ASSIGN(Profiler); 137 RTC_DISALLOW_COPY_AND_ASSIGN(Profiler);
138 }; 138 };
139 139
140 // Starts an event on construction and stops it on destruction. 140 // Starts an event on construction and stops it on destruction.
141 // Used by PROFILE macro. 141 // Used by PROFILE macro.
142 class ProfilerScope { 142 class ProfilerScope {
143 public: 143 public:
144 explicit ProfilerScope(const std::string& event_name) 144 explicit ProfilerScope(const std::string& event_name)
145 : event_name_(event_name) { 145 : event_name_(event_name) {
146 Profiler::Instance()->StartEvent(event_name_); 146 Profiler::Instance()->StartEvent(event_name_);
147 } 147 }
148 ~ProfilerScope() { 148 ~ProfilerScope() {
149 Profiler::Instance()->StopEvent(event_name_); 149 Profiler::Instance()->StopEvent(event_name_);
150 } 150 }
151 private: 151 private:
152 std::string event_name_; 152 std::string event_name_;
153 153
154 DISALLOW_COPY_AND_ASSIGN(ProfilerScope); 154 RTC_DISALLOW_COPY_AND_ASSIGN(ProfilerScope);
155 }; 155 };
156 156
157 std::ostream& operator<<(std::ostream& stream, 157 std::ostream& operator<<(std::ostream& stream,
158 const ProfilerEvent& profiler_event); 158 const ProfilerEvent& profiler_event);
159 159
160 } // namespace rtc 160 } // namespace rtc
161 161
162 #endif // WEBRTC_BASE_PROFILER_H_ 162 #endif // WEBRTC_BASE_PROFILER_H_
OLDNEW
« no previous file with comments | « webrtc/base/opensslidentity.h ('k') | webrtc/base/proxyserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698