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

Unified Diff: base/profiler.cc

Issue 40255: Add API functions to control Quantify, as well as expose these... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/profiler.h ('k') | webkit/build/V8Bindings/SConscript » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/profiler.cc
===================================================================
--- base/profiler.cc (revision 0)
+++ base/profiler.cc (revision 0)
@@ -0,0 +1,45 @@
+// Copyright (c) 2009 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.
+
+#include "base/profiler.h"
+#include "base/string_util.h"
+
+#ifdef PURIFY
+// this #define is used to prevent people from directly using pure.h
+// instead of profiler.h
+#define PURIFY_PRIVATE_INCLUDE
+#include "base/third_party/purify/pure.h"
+#endif
+
+namespace base {
+
+void Profiler::StartRecording() {
+#ifdef PURIFY
+ QuantifyStartRecordingData();
+#endif
+}
+
+void Profiler::StopRecording() {
+#ifdef PURIFY
+ QuantifyStopRecordingData();
+#endif
+}
+
+void Profiler::ClearData() {
+#ifdef PURIFY
+ QuantifyClearData();
+#endif
+}
+
+void Profiler::SetThreadName(const char *name) {
+#ifdef PURIFY
+ // make a copy since the Quantify function takes a char*, not const char*
+ char buffer[512];
+ base::snprintf(buffer, sizeof(buffer)-1, "%s", name);
+ QuantifySetThreadName(buffer);
+#endif
+}
+
+} // namespace base
+
Property changes on: base\profiler.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « base/profiler.h ('k') | webkit/build/V8Bindings/SConscript » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698