| 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 "base/gtest_prod_util.h" |
| 8 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 9 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 10 #include "content/public/browser/background_tracing_config.h" | 11 #include "content/public/browser/background_tracing_config.h" |
| 11 | 12 |
| 12 namespace content { | 13 namespace content { |
| 13 class BackgroundTracingRule; | 14 class BackgroundTracingRule; |
| 14 | 15 |
| 15 class CONTENT_EXPORT BackgroundTracingConfigImpl | 16 class CONTENT_EXPORT BackgroundTracingConfigImpl |
| 16 : public BackgroundTracingConfig { | 17 : public BackgroundTracingConfig { |
| 17 public: | 18 public: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 29 BENCHMARK_IPC, | 30 BENCHMARK_IPC, |
| 30 BENCHMARK_STARTUP, | 31 BENCHMARK_STARTUP, |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 CategoryPreset category_preset() const { return category_preset_; } | 34 CategoryPreset category_preset() const { return category_preset_; } |
| 34 void set_category_preset(CategoryPreset category_preset) { | 35 void set_category_preset(CategoryPreset category_preset) { |
| 35 category_preset_ = category_preset; | 36 category_preset_ = category_preset; |
| 36 } | 37 } |
| 37 | 38 |
| 38 const ScopedVector<BackgroundTracingRule>& rules() const { return rules_; } | 39 const ScopedVector<BackgroundTracingRule>& rules() const { return rules_; } |
| 40 const std::string& scenario_name() const { return scenario_name_; } |
| 41 const std::string& enable_blink_features() const { |
| 42 return enable_blink_features_; |
| 43 } |
| 44 const std::string& disable_blink_features() const { |
| 45 return disable_blink_features_; |
| 46 } |
| 39 | 47 |
| 40 void AddPreemptiveRule(const base::DictionaryValue* dict); | 48 void AddPreemptiveRule(const base::DictionaryValue* dict); |
| 41 void AddReactiveRule( | 49 void AddReactiveRule( |
| 42 const base::DictionaryValue* dict, | 50 const base::DictionaryValue* dict, |
| 43 BackgroundTracingConfigImpl::CategoryPreset category_preset); | 51 BackgroundTracingConfigImpl::CategoryPreset category_preset); |
| 44 | 52 |
| 45 static scoped_ptr<BackgroundTracingConfigImpl> PreemptiveFromDict( | 53 static scoped_ptr<BackgroundTracingConfigImpl> PreemptiveFromDict( |
| 46 const base::DictionaryValue* dict); | 54 const base::DictionaryValue* dict); |
| 47 static scoped_ptr<BackgroundTracingConfigImpl> ReactiveFromDict( | 55 static scoped_ptr<BackgroundTracingConfigImpl> ReactiveFromDict( |
| 48 const base::DictionaryValue* dict); | 56 const base::DictionaryValue* dict); |
| 49 | 57 |
| 50 static scoped_ptr<BackgroundTracingConfigImpl> FromDict( | 58 static scoped_ptr<BackgroundTracingConfigImpl> FromDict( |
| 51 const base::DictionaryValue* dict); | 59 const base::DictionaryValue* dict); |
| 52 | 60 |
| 53 static std::string CategoryPresetToString( | 61 static std::string CategoryPresetToString( |
| 54 BackgroundTracingConfigImpl::CategoryPreset category_preset); | 62 BackgroundTracingConfigImpl::CategoryPreset category_preset); |
| 55 static bool StringToCategoryPreset( | 63 static bool StringToCategoryPreset( |
| 56 const std::string& category_preset_string, | 64 const std::string& category_preset_string, |
| 57 BackgroundTracingConfigImpl::CategoryPreset* category_preset); | 65 BackgroundTracingConfigImpl::CategoryPreset* category_preset); |
| 58 | 66 |
| 59 private: | 67 private: |
| 68 FRIEND_TEST_ALL_PREFIXES(BackgroundTracingConfigTest, |
| 69 ValidPreemptiveConfigToString); |
| 70 |
| 60 CategoryPreset category_preset_; | 71 CategoryPreset category_preset_; |
| 61 ScopedVector<BackgroundTracingRule> rules_; | 72 ScopedVector<BackgroundTracingRule> rules_; |
| 73 std::string scenario_name_; |
| 74 std::string enable_blink_features_; |
| 75 std::string disable_blink_features_; |
| 62 | 76 |
| 63 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingConfigImpl); | 77 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingConfigImpl); |
| 64 }; | 78 }; |
| 65 | 79 |
| 66 } // namespace content | 80 } // namespace content |
| 67 | 81 |
| 68 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_CONFIG_IMPL_H_ | 82 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_CONFIG_IMPL_H_ |
| OLD | NEW |