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

Side by Side Diff: third_party/WebKit/Source/platform/TraceEvent.h

Issue 2359503002: Let TRACE_EVENT_XXX_WITH_TIMESTAMP accept TimeTicks instead of int64_t (Closed)
Patch Set: Rebase Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 TraceEvent_h 5 #ifndef TraceEvent_h
6 #define TraceEvent_h 6 #define TraceEvent_h
7 7
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "wtf/text/CString.h" 10 #include "wtf/text/CString.h"
11 11
12 namespace WTF { 12 namespace WTF {
13 13
14 // CString version of SetTraceValue so that trace arguments can be strings. 14 // CString version of SetTraceValue so that trace arguments can be strings.
15 static inline void SetTraceValue(const CString& arg, unsigned char* type, unsign ed long long* value) 15 static inline void SetTraceValue(const CString& arg, unsigned char* type, unsign ed long long* value)
16 { 16 {
17 trace_event_internal::TraceValueUnion typeValue; 17 trace_event_internal::TraceValueUnion typeValue;
18 typeValue.as_string = arg.data(); 18 typeValue.as_string = arg.data();
19 *type = TRACE_VALUE_TYPE_COPY_STRING; 19 *type = TRACE_VALUE_TYPE_COPY_STRING;
20 *value = typeValue.as_uint; 20 *value = typeValue.as_uint;
21 } 21 }
22 22
23 } // namespace WTF 23 } // namespace WTF
24 24
25 namespace blink { 25 namespace blink {
26 namespace TraceEvent { 26 namespace TraceEvent {
27 27
28 using base::trace_event::TraceScopedTrackableObject; 28 using base::trace_event::TraceScopedTrackableObject;
29 29
30 inline int64_t toTraceTimestamp(double seconds) 30 inline base::TimeTicks toTraceTimestamp(double seconds)
31 { 31 {
32 return (base::TimeTicks() + base::TimeDelta::FromSecondsD(seconds)).ToIntern alValue(); 32 return base::TimeTicks() + base::TimeDelta::FromSecondsD(seconds);
33 } 33 }
34 34
35 // This is to avoid error of passing a chromium time internal value.
36 void toTraceTimestamp(int64_t);
37
35 } // namespace TraceEvent 38 } // namespace TraceEvent
36 } // namespace blink 39 } // namespace blink
37 40
38 #endif 41 #endif
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_tracer.cc ('k') | third_party/WebKit/Source/platform/scheduler/child/idle_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698