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

Side by Side Diff: base/trace_event/persistent_async_event.h

Issue 2159323002: Add tracing AutoOpenCloseEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review changes 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_TRACE_EVENT_PERSISTENT_ASYNC_H_
6 #define BASE_TRACE_EVENT_PERSISTENT_ASYNC_H_
7
8 #include "base/macros.h"
9 #include "base/time/time.h"
10 #include "base/trace_event/trace_event.h"
11
12 namespace base {
13
14 namespace trace_event {
15
16 // Note: The categories and event names must have application lifetime
17 // (i.e. literals), as documented in trace_event_common.h.
18 // Thus, we must make subclasses that have hard-coded categories
19 // and event names, rather than passing these into the PersistentAsyncEvent.
20
21 class BASE_EXPORT PersistentAsyncEvent
22 : public trace_event::TraceLog::EnabledStateObserver {
23 public:
24 PersistentAsyncEvent();
25 ~PersistentAsyncEvent() override;
26
27 void Start();
benjhayden 2016/08/31 03:12:53 Can you change Start to Begin and Stop to End to b
charliea (OOO until 10-5) 2016/08/31 17:30:38 +1
alexandermont 2016/08/31 18:31:59 Done
28 void Stop();
29
30 void OnTraceLogEnabled() override;
31 void OnTraceLogDisabled() override;
32
33 protected:
34 virtual void RecordStartEvent() = 0;
35 virtual void RecordStartEventWithTimestamp(int64_t timestamp) = 0;
36 virtual void RecordStopEvent() = 0;
37
38 void* id_;
39 bool active_;
40 int64_t start_time_;
charliea (OOO until 10-5) 2016/08/31 17:30:38 As you mentioned, I think this should be stored as
alexandermont 2016/08/31 18:31:59 Done
41 };
42
43 } // namespace trace_event
44 } // namespace base
45
46 #endif // BASE_TRACE_EVENT_PERSISTENT_ASYNC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698