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

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

Issue 2053233002: Make sure FrameScheduler is cleared when LocalFrame::detach() finishes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 BASE_TRACE_EVENT_BLAME_CONTEXT_H_ 5 #ifndef BASE_TRACE_EVENT_BLAME_CONTEXT_H_
6 #define BASE_TRACE_EVENT_BLAME_CONTEXT_H_ 6 #define BASE_TRACE_EVENT_BLAME_CONTEXT_H_
7 7
8 #include <inttypes.h> 8 #include <inttypes.h>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 const char* category() const { return category_; } 97 const char* category() const { return category_; }
98 const char* name() const { return name_; } 98 const char* name() const { return name_; }
99 const char* type() const { return type_; } 99 const char* type() const { return type_; }
100 const char* scope() const { return scope_; } 100 const char* scope() const { return scope_; }
101 int64_t id() const { return id_; } 101 int64_t id() const { return id_; }
102 102
103 // trace_event::TraceLog::EnabledStateObserver implementation: 103 // trace_event::TraceLog::EnabledStateObserver implementation:
104 void OnTraceLogEnabled() override; 104 void OnTraceLogEnabled() override;
105 void OnTraceLogDisabled() override; 105 void OnTraceLogDisabled() override;
106 106
107 // Returns a WeakPtr of itself.
108 WeakPtr<BlameContext> weak_ptr() { return weak_factory_.GetWeakPtr(); }
109
107 protected: 110 protected:
108 // Serialize the properties of this blame context into |state|. Subclasses can 111 // Serialize the properties of this blame context into |state|. Subclasses can
109 // override this method to record additional properties (e.g, the URL for an 112 // override this method to record additional properties (e.g, the URL for an
110 // <iframe> blame context). Note that an overridden implementation must still 113 // <iframe> blame context). Note that an overridden implementation must still
111 // call this base method. 114 // call this base method.
112 virtual void AsValueInto(trace_event::TracedValue* state); 115 virtual void AsValueInto(trace_event::TracedValue* state);
113 116
114 private: 117 private:
115 bool WasInitialized() const; 118 bool WasInitialized() const;
116 119
(...skipping 12 matching lines...) Expand all
129 ThreadChecker thread_checker_; 132 ThreadChecker thread_checker_;
130 WeakPtrFactory<BlameContext> weak_factory_; 133 WeakPtrFactory<BlameContext> weak_factory_;
131 134
132 DISALLOW_COPY_AND_ASSIGN(BlameContext); 135 DISALLOW_COPY_AND_ASSIGN(BlameContext);
133 }; 136 };
134 137
135 } // namespace trace_event 138 } // namespace trace_event
136 } // namespace base 139 } // namespace base
137 140
138 #endif // BASE_TRACE_EVENT_BLAME_CONTEXT_H_ 141 #endif // BASE_TRACE_EVENT_BLAME_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698