OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "base/profiler.h" | 5 #include "base/profiler.h" |
6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
7 | 7 |
8 // When actually using quantify, uncomment the following line. | 8 // When actually using quantify, uncomment the following line. |
9 //#define QUANTIFY | 9 // #define QUANTIFY |
10 | 10 |
11 #ifdef QUANTIFY | 11 #ifdef QUANTIFY |
12 // this #define is used to prevent people from directly using pure.h | 12 // this #define is used to prevent people from directly using pure.h |
13 // instead of profiler.h | 13 // instead of profiler.h |
14 #define PURIFY_PRIVATE_INCLUDE | 14 #define PURIFY_PRIVATE_INCLUDE |
15 #include "base/third_party/purify/pure.h" | 15 #include "base/third_party/purify/pure.h" |
16 #endif // QUANTIFY | 16 #endif // QUANTIFY |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 | 19 |
(...skipping 18 matching lines...) Expand all Loading... |
38 void Profiler::SetThreadName(const char *name) { | 38 void Profiler::SetThreadName(const char *name) { |
39 #ifdef QUANTIFY | 39 #ifdef QUANTIFY |
40 // make a copy since the Quantify function takes a char*, not const char* | 40 // make a copy since the Quantify function takes a char*, not const char* |
41 char buffer[512]; | 41 char buffer[512]; |
42 base::snprintf(buffer, sizeof(buffer)-1, "%s", name); | 42 base::snprintf(buffer, sizeof(buffer)-1, "%s", name); |
43 QuantifySetThreadName(buffer); | 43 QuantifySetThreadName(buffer); |
44 #endif | 44 #endif |
45 } | 45 } |
46 | 46 |
47 } // namespace base | 47 } // namespace base |
OLD | NEW |