OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/debug/trace_event_impl.h" | 5 #include "base/debug/trace_event_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 StringTokenizer tokens(*ci, ";"); | 1312 StringTokenizer tokens(*ci, ";"); |
1313 if (!tokens.GetNext()) | 1313 if (!tokens.GetNext()) |
1314 continue; | 1314 continue; |
1315 TraceEventSyntheticDelay* delay = | 1315 TraceEventSyntheticDelay* delay = |
1316 TraceEventSyntheticDelay::Lookup(tokens.token()); | 1316 TraceEventSyntheticDelay::Lookup(tokens.token()); |
1317 while (tokens.GetNext()) { | 1317 while (tokens.GetNext()) { |
1318 std::string token = tokens.token(); | 1318 std::string token = tokens.token(); |
1319 char* duration_end; | 1319 char* duration_end; |
1320 double target_duration = strtod(token.c_str(), &duration_end); | 1320 double target_duration = strtod(token.c_str(), &duration_end); |
1321 if (duration_end != token.c_str()) { | 1321 if (duration_end != token.c_str()) { |
1322 delay->SetTargetDuration( | 1322 delay->SetTargetDuration(TimeDelta::FromMicroseconds( |
1323 TimeDelta::FromMicroseconds(target_duration * 1e6)); | 1323 static_cast<int64>(target_duration * 1e6))); |
1324 } else if (token == "static") { | 1324 } else if (token == "static") { |
1325 delay->SetMode(TraceEventSyntheticDelay::STATIC); | 1325 delay->SetMode(TraceEventSyntheticDelay::STATIC); |
1326 } else if (token == "oneshot") { | 1326 } else if (token == "oneshot") { |
1327 delay->SetMode(TraceEventSyntheticDelay::ONE_SHOT); | 1327 delay->SetMode(TraceEventSyntheticDelay::ONE_SHOT); |
1328 } else if (token == "alternating") { | 1328 } else if (token == "alternating") { |
1329 delay->SetMode(TraceEventSyntheticDelay::ALTERNATING); | 1329 delay->SetMode(TraceEventSyntheticDelay::ALTERNATING); |
1330 } | 1330 } |
1331 } | 1331 } |
1332 } | 1332 } |
1333 } | 1333 } |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2571 } | 2571 } |
2572 | 2572 |
2573 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { | 2573 ScopedTraceBinaryEfficient::~ScopedTraceBinaryEfficient() { |
2574 if (*category_group_enabled_) { | 2574 if (*category_group_enabled_) { |
2575 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, | 2575 TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION(category_group_enabled_, |
2576 name_, event_handle_); | 2576 name_, event_handle_); |
2577 } | 2577 } |
2578 } | 2578 } |
2579 | 2579 |
2580 } // namespace trace_event_internal | 2580 } // namespace trace_event_internal |
OLD | NEW |