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

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: Created 4 years, 5 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/trace_event/trace_event.h"
10 #include <string>
11 #include <ctime>
12
13 namespace base {
14 namespace trace_event {
15
16 // Note: The categories and event names must have application lifetime
charliea (OOO until 10-5) 2016/07/19 20:27:18 Take a look at https://cs.chromium.org/chromium/sr
17 // (strings or literals), as documented in trace_event_common.h.
18 // Thus, we must makes 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:
benjhayden 2016/08/10 18:30:00 These should only be indented by 1 space.
24 PersistentAsyncEvent();
25 ~PersistentAsyncEvent() override;
26
27 void Start(std::string param_value = "");
28 void Stop(std::string param_value = "");
29
30 virtual void RecordStartEvent();
31 virtual void RecordStartEventWithOffset(double offset);
32 virtual void RecordStopEvent();
33 void OnTraceLogEnabled() override;
34 void OnTraceLogDisabled() override;
35
36 protected:
benjhayden 2016/08/10 18:30:00 only indent by 1 space
37 std::string param_value_;
38
39 bool active_;
40 timeval start_time_;
41 };
42
43 }
benjhayden 2016/08/10 18:30:00 } // namespace trace_event
44 }
benjhayden 2016/08/10 18:30:00 } // namespace base
45
46 #endif // BASE_TRACE_EVENT_PERSISTENT_ASYNC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698