OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_CONFIG_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_CONFIG_IMPL_H_ |
6 #define CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_CONFIG_IMPL_H_ | 6 #define CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_CONFIG_IMPL_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 #include <vector> |
| 10 |
8 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
9 #include "base/macros.h" | 12 #include "base/macros.h" |
10 #include "base/memory/scoped_vector.h" | |
11 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
12 #include "content/public/browser/background_tracing_config.h" | 14 #include "content/public/browser/background_tracing_config.h" |
13 | 15 |
14 namespace content { | 16 namespace content { |
15 class BackgroundTracingRule; | 17 class BackgroundTracingRule; |
16 | 18 |
17 class CONTENT_EXPORT BackgroundTracingConfigImpl | 19 class CONTENT_EXPORT BackgroundTracingConfigImpl |
18 : public BackgroundTracingConfig { | 20 : public BackgroundTracingConfig { |
19 public: | 21 public: |
20 explicit BackgroundTracingConfigImpl(TracingMode tracing_mode); | 22 explicit BackgroundTracingConfigImpl(TracingMode tracing_mode); |
(...skipping 15 matching lines...) Expand all Loading... |
36 BENCHMARK_MEMORY_LIGHT, | 38 BENCHMARK_MEMORY_LIGHT, |
37 BENCHMARK_EXECUTION_METRIC, | 39 BENCHMARK_EXECUTION_METRIC, |
38 BLINK_STYLE | 40 BLINK_STYLE |
39 }; | 41 }; |
40 | 42 |
41 CategoryPreset category_preset() const { return category_preset_; } | 43 CategoryPreset category_preset() const { return category_preset_; } |
42 void set_category_preset(CategoryPreset category_preset) { | 44 void set_category_preset(CategoryPreset category_preset) { |
43 category_preset_ = category_preset; | 45 category_preset_ = category_preset; |
44 } | 46 } |
45 | 47 |
46 const ScopedVector<BackgroundTracingRule>& rules() const { return rules_; } | 48 const std::vector<std::unique_ptr<BackgroundTracingRule>>& rules() const { |
| 49 return rules_; |
| 50 } |
47 const std::string& scenario_name() const { return scenario_name_; } | 51 const std::string& scenario_name() const { return scenario_name_; } |
48 const std::string& enable_blink_features() const { | 52 const std::string& enable_blink_features() const { |
49 return enable_blink_features_; | 53 return enable_blink_features_; |
50 } | 54 } |
51 const std::string& disable_blink_features() const { | 55 const std::string& disable_blink_features() const { |
52 return disable_blink_features_; | 56 return disable_blink_features_; |
53 } | 57 } |
54 | 58 |
55 void AddPreemptiveRule(const base::DictionaryValue* dict); | 59 void AddPreemptiveRule(const base::DictionaryValue* dict); |
56 void AddReactiveRule( | 60 void AddReactiveRule( |
(...skipping 12 matching lines...) Expand all Loading... |
69 BackgroundTracingConfigImpl::CategoryPreset category_preset); | 73 BackgroundTracingConfigImpl::CategoryPreset category_preset); |
70 static bool StringToCategoryPreset( | 74 static bool StringToCategoryPreset( |
71 const std::string& category_preset_string, | 75 const std::string& category_preset_string, |
72 BackgroundTracingConfigImpl::CategoryPreset* category_preset); | 76 BackgroundTracingConfigImpl::CategoryPreset* category_preset); |
73 | 77 |
74 private: | 78 private: |
75 FRIEND_TEST_ALL_PREFIXES(BackgroundTracingConfigTest, | 79 FRIEND_TEST_ALL_PREFIXES(BackgroundTracingConfigTest, |
76 ValidPreemptiveConfigToString); | 80 ValidPreemptiveConfigToString); |
77 | 81 |
78 CategoryPreset category_preset_; | 82 CategoryPreset category_preset_; |
79 ScopedVector<BackgroundTracingRule> rules_; | 83 std::vector<std::unique_ptr<BackgroundTracingRule>> rules_; |
80 std::string scenario_name_; | 84 std::string scenario_name_; |
81 std::string enable_blink_features_; | 85 std::string enable_blink_features_; |
82 std::string disable_blink_features_; | 86 std::string disable_blink_features_; |
83 | 87 |
84 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingConfigImpl); | 88 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingConfigImpl); |
85 }; | 89 }; |
86 | 90 |
87 } // namespace content | 91 } // namespace content |
88 | 92 |
89 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_CONFIG_IMPL_H_ | 93 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_CONFIG_IMPL_H_ |
OLD | NEW |