| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "base/trace_event/trace_config.h" | 5 #include "base/trace_event/trace_config.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include <utility> | 9 #include <utility> |
| 8 | 10 |
| 9 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
| 11 #include "base/strings/pattern.h" | 13 #include "base/strings/pattern.h" |
| 12 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
| 13 #include "base/strings/string_tokenizer.h" | 15 #include "base/strings/string_tokenizer.h" |
| 14 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 15 #include "base/trace_event/memory_dump_manager.h" | 17 #include "base/trace_event/memory_dump_manager.h" |
| 16 #include "base/trace_event/memory_dump_request_args.h" | 18 #include "base/trace_event/memory_dump_request_args.h" |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 if (!trigger_list->GetDictionary(i, &trigger)) | 492 if (!trigger_list->GetDictionary(i, &trigger)) |
| 491 continue; | 493 continue; |
| 492 | 494 |
| 493 MemoryDumpTriggerConfig dump_config; | 495 MemoryDumpTriggerConfig dump_config; |
| 494 int interval = 0; | 496 int interval = 0; |
| 495 | 497 |
| 496 if (!trigger->GetInteger(kPeriodicIntervalParam, &interval)) { | 498 if (!trigger->GetInteger(kPeriodicIntervalParam, &interval)) { |
| 497 continue; | 499 continue; |
| 498 } | 500 } |
| 499 DCHECK_GT(interval, 0); | 501 DCHECK_GT(interval, 0); |
| 500 dump_config.periodic_interval_ms = static_cast<uint32>(interval); | 502 dump_config.periodic_interval_ms = static_cast<uint32_t>(interval); |
| 501 std::string level_of_detail_str; | 503 std::string level_of_detail_str; |
| 502 trigger->GetString(kModeParam, &level_of_detail_str); | 504 trigger->GetString(kModeParam, &level_of_detail_str); |
| 503 dump_config.level_of_detail = | 505 dump_config.level_of_detail = |
| 504 StringToMemoryDumpLevelOfDetail(level_of_detail_str); | 506 StringToMemoryDumpLevelOfDetail(level_of_detail_str); |
| 505 memory_dump_config_.push_back(dump_config); | 507 memory_dump_config_.push_back(dump_config); |
| 506 } | 508 } |
| 507 } | 509 } |
| 508 | 510 |
| 509 void TraceConfig::SetDefaultMemoryDumpConfig() { | 511 void TraceConfig::SetDefaultMemoryDumpConfig() { |
| 510 memory_dump_config_.clear(); | 512 memory_dump_config_.clear(); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 str.at(0) == ' ' || | 662 str.at(0) == ' ' || |
| 661 str.at(str.length() - 1) == ' '; | 663 str.at(str.length() - 1) == ' '; |
| 662 } | 664 } |
| 663 | 665 |
| 664 bool TraceConfig::HasIncludedPatterns() const { | 666 bool TraceConfig::HasIncludedPatterns() const { |
| 665 return !included_categories_.empty(); | 667 return !included_categories_.empty(); |
| 666 } | 668 } |
| 667 | 669 |
| 668 } // namespace trace_event | 670 } // namespace trace_event |
| 669 } // namespace base | 671 } // namespace base |
| OLD | NEW |