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

Side by Side Diff: base/trace_event/trace_event_filter_test_utils.h

Issue 2549103003: tracing: split trace event filter classes out of TraceLog (Closed)
Patch Set: Add BASE_EXPORT Created 4 years 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_FILTER_TEST_UTILS_H_
6 #define BASE_TRACE_EVENT_TRACE_EVENT_FILTER_TEST_UTILS_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/macros.h"
12 #include "base/trace_event/trace_event_filter.h"
13
14 namespace base {
15 namespace trace_event {
16
17 class TestEventFilter : public TraceEventFilter {
18 public:
19 struct HitsCounter {
20 HitsCounter();
21 ~HitsCounter();
22 void Reset();
23 size_t filter_trace_event_hit_count;
24 size_t end_event_hit_count;
25 };
26
27 static const char kName[];
28
29 // Factory method for TraceLog::SetFilterFactoryForTesting().
30 static std::unique_ptr<TraceEventFilter> Factory(
31 const std::string& predicate_name);
32
33 TestEventFilter();
34 ~TestEventFilter() override;
35
36 // TraceEventFilter implementation.
37 bool FilterTraceEvent(const TraceEvent& trace_event) const override;
38 void EndEvent(const char* category_name, const char* name) const override;
39
40 static void set_filter_return_value(bool value) {
41 filter_return_value_ = value;
42 }
43
44 private:
45 static bool filter_return_value_;
46
47 DISALLOW_COPY_AND_ASSIGN(TestEventFilter);
48 };
49
50 } // namespace trace_event
51 } // namespace base
52
53 #endif // BASE_TRACE_EVENT_TRACE_EVENT_FILTER_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « base/trace_event/trace_event_filter.cc ('k') | base/trace_event/trace_event_filter_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698