Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Unified Diff: base/debug/trace_event_impl.cc

Issue 443523003: Remove TraceOptions string based constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/debug/trace_event_impl.h ('k') | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/trace_event_impl.cc
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc
index a9f058324c71491b82195370b4a6370b960f196a..5c521d462fe0e73c766d801f1b4340ad2d82670f 100644
--- a/base/debug/trace_event_impl.cc
+++ b/base/debug/trace_event_impl.cc
@@ -984,13 +984,13 @@ TraceBucketData::~TraceBucketData() {
//
////////////////////////////////////////////////////////////////////////////////
-TraceOptions::TraceOptions(const std::string& options_string)
- : record_mode(RECORD_UNTIL_FULL),
- enable_sampling(false),
- enable_systrace(false) {
+bool TraceOptions::SetFromString(const std::string& options_string) {
+ record_mode = RECORD_UNTIL_FULL;
+ enable_sampling = false;
+ enable_systrace = false;
+
std::vector<std::string> split;
std::vector<std::string>::iterator iter;
-
base::SplitString(options_string, ',', &split);
for (iter = split.begin(); iter != split.end(); ++iter) {
if (*iter == kRecordUntilFull) {
@@ -1006,9 +1006,10 @@ TraceOptions::TraceOptions(const std::string& options_string)
} else if (*iter == kEnableSystrace) {
enable_systrace = true;
} else {
- NOTREACHED();
+ return false;
}
}
+ return true;
}
std::string TraceOptions::ToString() const {
« no previous file with comments | « base/debug/trace_event_impl.h ('k') | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698