OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DEBUG_TRACE_EVENT_IMPL_H_ | 6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
8 | 8 |
9 #include <stack> | 9 #include <stack> |
10 #include <string> | 10 #include <string> |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 313 |
314 CategoryFilter& operator=(const CategoryFilter& rhs); | 314 CategoryFilter& operator=(const CategoryFilter& rhs); |
315 | 315 |
316 // Writes the string representation of the CategoryFilter. This is a comma | 316 // Writes the string representation of the CategoryFilter. This is a comma |
317 // separated string, similar in nature to the one used to determine | 317 // separated string, similar in nature to the one used to determine |
318 // enabled/disabled category patterns, except here there is an arbitrary | 318 // enabled/disabled category patterns, except here there is an arbitrary |
319 // order, included categories go first, then excluded categories. Excluded | 319 // order, included categories go first, then excluded categories. Excluded |
320 // categories are distinguished from included categories by the prefix '-'. | 320 // categories are distinguished from included categories by the prefix '-'. |
321 std::string ToString() const; | 321 std::string ToString() const; |
322 | 322 |
323 // Determines whether category group would be enabled or | 323 // Returns true if at least one category in the list is enabled by this |
324 // disabled by this category filter. | 324 // category filter. |
325 bool IsCategoryGroupEnabled(const char* category_group) const; | 325 bool IsCategoryGroupEnabled(const char* category_group) const; |
326 | 326 |
327 // Return a list of the synthetic delays specified in this category filter. | 327 // Return a list of the synthetic delays specified in this category filter. |
328 const StringList& GetSyntheticDelayValues() const; | 328 const StringList& GetSyntheticDelayValues() const; |
329 | 329 |
330 // Merges nested_filter with the current CategoryFilter | 330 // Merges nested_filter with the current CategoryFilter |
331 void Merge(const CategoryFilter& nested_filter); | 331 void Merge(const CategoryFilter& nested_filter); |
332 | 332 |
333 // Clears both included/excluded pattern lists. This would be equivalent to | 333 // Clears both included/excluded pattern lists. This would be equivalent to |
334 // creating a CategoryFilter with an empty string, through the constructor. | 334 // creating a CategoryFilter with an empty string, through the constructor. |
335 // i.e: CategoryFilter(). | 335 // i.e: CategoryFilter(). |
336 // | 336 // |
337 // When using an empty filter, all categories are considered included as we | 337 // When using an empty filter, all categories are considered included as we |
338 // are not excluding anything. | 338 // are not excluding anything. |
339 void Clear(); | 339 void Clear(); |
340 | 340 |
341 private: | 341 private: |
342 FRIEND_TEST_ALL_PREFIXES(TraceEventTestFixture, CategoryFilter); | 342 FRIEND_TEST_ALL_PREFIXES(TraceEventTestFixture, CategoryFilter); |
343 | 343 |
| 344 // Returns true if category is enable according to this filter. |
| 345 bool IsCategoryEnabled(const char* category_name) const; |
| 346 |
344 static bool IsEmptyOrContainsLeadingOrTrailingWhitespace( | 347 static bool IsEmptyOrContainsLeadingOrTrailingWhitespace( |
345 const std::string& str); | 348 const std::string& str); |
346 | 349 |
347 void Initialize(const std::string& filter_string); | 350 void Initialize(const std::string& filter_string); |
348 void WriteString(const StringList& values, | 351 void WriteString(const StringList& values, |
349 std::string* out, | 352 std::string* out, |
350 bool included) const; | 353 bool included) const; |
351 void WriteString(const StringList& delays, std::string* out) const; | 354 void WriteString(const StringList& delays, std::string* out) const; |
352 bool HasIncludedPatterns() const; | 355 bool HasIncludedPatterns() const; |
353 | 356 |
354 bool DoesCategoryGroupContainCategory(const char* category_group, | |
355 const char* category) const; | |
356 | |
357 StringList included_; | 357 StringList included_; |
358 StringList disabled_; | 358 StringList disabled_; |
359 StringList excluded_; | 359 StringList excluded_; |
360 StringList delays_; | 360 StringList delays_; |
361 }; | 361 }; |
362 | 362 |
363 class TraceSamplingThread; | 363 class TraceSamplingThread; |
364 | 364 |
365 // Options determines how the trace buffer stores data. | 365 // Options determines how the trace buffer stores data. |
366 enum TraceRecordMode { | 366 enum TraceRecordMode { |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; | 805 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; |
806 subtle::AtomicWord generation_; | 806 subtle::AtomicWord generation_; |
807 | 807 |
808 DISALLOW_COPY_AND_ASSIGN(TraceLog); | 808 DISALLOW_COPY_AND_ASSIGN(TraceLog); |
809 }; | 809 }; |
810 | 810 |
811 } // namespace debug | 811 } // namespace debug |
812 } // namespace base | 812 } // namespace base |
813 | 813 |
814 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ | 814 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ |
OLD | NEW |