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