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

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

Issue 1776673002: base: Add blame context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split into BlameContext and TracedBlameContext. Created 4 years, 9 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_BLAME_CONTEXT_H_
6 #define BASE_TRACE_EVENT_BLAME_CONTEXT_H_
7
8 #include <inttypes.h>
9
10 #include "base/base_export.h"
11 #include "base/macros.h"
12 #include "base/trace_event/trace_event.h"
13
14 namespace base {
15 namespace trace_event {
16
17 // A blame context represents a logical unit to which we want to attribute
18 // different costs (e.g., CPU, network, or memory usage). An example of a blame
19 // context is an <iframe> element on a web page. Different subsystems can
20 // "enter" and "leave" blame contexts to indicate that they are doing work which
21 // should be accounted against this blame context.
22 class BASE_EXPORT BlameContext {
23 public:
24 // Indicate that the current thread is now doing work which should count
25 // against this blame context.
26 virtual void Enter() = 0;
27
28 // Leave and stop doing work for a previously entered blame context. If
29 // another blame context of the same type was entered prior to this one, it
30 // becomes the active blame context for this thread again.
31 virtual void Leave() = 0;
32
33 protected:
34 BlameContext() {}
35 virtual ~BlameContext() {}
danakj 2016/03/16 18:29:49 do you need to define this destructor? making a de
Sami 2016/03/17 12:27:13 I guess I wouldn't have needed this for the interf
36
37 DISALLOW_COPY_AND_ASSIGN(BlameContext);
38 };
39
40 } // namespace trace_event
41 } // namespace base
42
43 #endif // BASE_TRACE_EVENT_BLAME_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698