diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-01-25 11:39:07 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-01-25 15:20:42 +0000 |
commit | 6c91641271e536ffaa88a1dff5127e42ee99a91e (patch) | |
tree | 703d9dd49602377ddc90cbf886aad37913f2496b /chromium/base/trace_event/trace_config.cc | |
parent | b145b7fafd36f0c260d6a768c81fc14e32578099 (diff) |
BASELINE: Update Chromium to 49.0.2623.23
Also adds missing printing sources.
Change-Id: I3726b8f0c7d6751c9fc846096c571fadca7108cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'chromium/base/trace_event/trace_config.cc')
-rw-r--r-- | chromium/base/trace_event/trace_config.cc | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/chromium/base/trace_event/trace_config.cc b/chromium/base/trace_event/trace_config.cc index 9f0367bd2a2..8e11078ebc7 100644 --- a/chromium/base/trace_event/trace_config.cc +++ b/chromium/base/trace_event/trace_config.cc @@ -4,6 +4,10 @@ #include "base/trace_event/trace_config.h" +#include <stddef.h> + +#include <utility> + #include "base/json/json_reader.h" #include "base/json/json_writer.h" #include "base/strings/pattern.h" @@ -54,6 +58,22 @@ const TraceConfig::MemoryDumpTriggerConfig kDefaultLightMemoryDumpTrigger = { 250, // periodic_interval_ms MemoryDumpLevelOfDetail::LIGHT}; +class ConvertableTraceConfigToTraceFormat + : public base::trace_event::ConvertableToTraceFormat { + public: + explicit ConvertableTraceConfigToTraceFormat(const TraceConfig& trace_config) + : trace_config_(trace_config) {} + void AppendAsTraceFormat(std::string* out) const override { + out->append(trace_config_.ToString()); + } + + protected: + ~ConvertableTraceConfigToTraceFormat() override {} + + private: + const TraceConfig trace_config_; +}; + } // namespace TraceConfig::TraceConfig() { @@ -138,6 +158,11 @@ std::string TraceConfig::ToString() const { return json; } +scoped_refptr<ConvertableToTraceFormat> +TraceConfig::AsConvertableToTraceFormat() const { + return new ConvertableTraceConfigToTraceFormat(*this); +} + std::string TraceConfig::ToCategoryFilterString() const { std::string filter_string; WriteCategoryFilterString(included_categories_, &filter_string, true); @@ -188,9 +213,13 @@ bool TraceConfig::IsCategoryGroupEnabled( break; } // One of the category of category_group_name is not present in - // excluded_ list. So, it has to be included_ list. Enable the - // category_group_name for recording. - category_group_disabled = false; + // excluded_ list. So, if it's not a disabled-by-default category, + // it has to be included_ list. Enable the category_group_name + // for recording. + if (!base::MatchPattern(category_group_token.c_str(), + TRACE_DISABLED_BY_DEFAULT("*"))) { + category_group_disabled = false; + } } // One of the categories present in category_group_name is not present in // excluded_ list. Implies this category_group_name group can be enabled @@ -445,7 +474,7 @@ void TraceConfig::AddCategoryToDict(base::DictionaryValue& dict, list->AppendString(*ci); } - dict.Set(param, list.Pass()); + dict.Set(param, std::move(list)); } void TraceConfig::SetMemoryDumpConfig( @@ -470,7 +499,7 @@ void TraceConfig::SetMemoryDumpConfig( continue; } DCHECK_GT(interval, 0); - dump_config.periodic_interval_ms = static_cast<uint32>(interval); + dump_config.periodic_interval_ms = static_cast<uint32_t>(interval); std::string level_of_detail_str; trigger->GetString(kModeParam, &level_of_detail_str); dump_config.level_of_detail = @@ -537,13 +566,13 @@ void TraceConfig::ToDict(base::DictionaryValue& dict) const { static_cast<int>(config.periodic_interval_ms)); trigger_dict->SetString( kModeParam, MemoryDumpLevelOfDetailToString(config.level_of_detail)); - triggers_list->Append(trigger_dict.Pass()); + triggers_list->Append(std::move(trigger_dict)); } // Empty triggers will still be specified explicitly since it means that // the periodic dumps are not enabled. - memory_dump_config->Set(kTriggersParam, triggers_list.Pass()); - dict.Set(kMemoryDumpConfigParam, memory_dump_config.Pass()); + memory_dump_config->Set(kTriggersParam, std::move(triggers_list)); + dict.Set(kMemoryDumpConfigParam, std::move(memory_dump_config)); } } |