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

Unified Diff: base/debug/trace_event_impl.cc

Issue 12676007: Skip default categories when getting known categories. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 | « no previous file | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_impl.cc
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc
index d543d873ac19998b4f8559254d4318d6a2b4482a..1d368f191e060e5e34e7cc93f0a4b8fde33ed267 100644
--- a/base/debug/trace_event_impl.cc
+++ b/base/debug/trace_event_impl.cc
@@ -74,7 +74,8 @@ unsigned char g_category_enabled[TRACE_EVENT_MAX_CATEGORIES] = { 0 };
const int g_category_already_shutdown = 0;
const int g_category_categories_exhausted = 1;
const int g_category_metadata = 2;
-int g_category_index = 3; // skip initial 3 categories
+const int g_num_builtin_categories = 3;
+int g_category_index = g_num_builtin_categories; // Skip default categories.
// The name of the current thread. This is used to decide if the current
// thread name has changed. We combine all the seen thread names into the
@@ -782,7 +783,7 @@ const unsigned char* TraceLog::GetCategoryEnabledInternal(const char* name) {
void TraceLog::GetKnownCategories(std::vector<std::string>* categories) {
AutoLock lock(lock_);
- for (int i = 0; i < g_category_index; i++)
+ for (int i = g_num_builtin_categories; i < g_category_index; i++)
categories->push_back(g_categories[i]);
}
« no previous file with comments | « no previous file | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698