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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.h

Issue 2625093002: [wrapper-tracing] Add heap snapshot generator infrastructure (Closed)
Patch Set: Rebase and fix CHECK Created 3 years, 11 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 void setThreadDebugger(std::unique_ptr<ThreadDebugger>); 160 void setThreadDebugger(std::unique_ptr<ThreadDebugger>);
161 ThreadDebugger* threadDebugger(); 161 ThreadDebugger* threadDebugger();
162 162
163 using ActiveScriptWrappableSet = 163 using ActiveScriptWrappableSet =
164 HeapHashSet<WeakMember<ActiveScriptWrappableBase>>; 164 HeapHashSet<WeakMember<ActiveScriptWrappableBase>>;
165 void addActiveScriptWrappable(ActiveScriptWrappableBase*); 165 void addActiveScriptWrappable(ActiveScriptWrappableBase*);
166 const ActiveScriptWrappableSet* activeScriptWrappables() const { 166 const ActiveScriptWrappableSet* activeScriptWrappables() const {
167 return m_activeScriptWrappables.get(); 167 return m_activeScriptWrappables.get();
168 } 168 }
169 169
170 class TemporaryScriptWrappableVisitorScope {
171 WTF_MAKE_NONCOPYABLE(TemporaryScriptWrappableVisitorScope);
172 STACK_ALLOCATED();
173
174 public:
175 TemporaryScriptWrappableVisitorScope(
176 v8::Isolate* isolate,
177 std::unique_ptr<ScriptWrappableVisitor> visitor)
178 : m_isolate(isolate) {
179 swapWithV8PerIsolateDataVisitor(visitor);
180 }
181 ~TemporaryScriptWrappableVisitorScope() {
182 swapWithV8PerIsolateDataVisitor(m_savedVisitor);
183 }
184
185 private:
186 inline ScriptWrappableVisitor* currentVisitor(v8::Isolate* isolate) {
187 return V8PerIsolateData::from(m_isolate)->scriptWrappableVisitor();
188 }
189
190 void swapWithV8PerIsolateDataVisitor(
191 std::unique_ptr<ScriptWrappableVisitor>&);
192
193 v8::Isolate* m_isolate;
194 std::unique_ptr<ScriptWrappableVisitor> m_savedVisitor;
195 };
196
170 void setScriptWrappableVisitor( 197 void setScriptWrappableVisitor(
171 std::unique_ptr<ScriptWrappableVisitor> visitor) { 198 std::unique_ptr<ScriptWrappableVisitor> visitor) {
172 m_scriptWrappableVisitor = std::move(visitor); 199 m_scriptWrappableVisitor = std::move(visitor);
173 } 200 }
174 ScriptWrappableVisitor* scriptWrappableVisitor() { 201 ScriptWrappableVisitor* scriptWrappableVisitor() {
175 return m_scriptWrappableVisitor.get(); 202 return m_scriptWrappableVisitor.get();
176 } 203 }
177 204
178 private: 205 private:
179 explicit V8PerIsolateData(WebTaskRunner*); 206 explicit V8PerIsolateData(WebTaskRunner*);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 Vector<std::unique_ptr<EndOfScopeTask>> m_endOfScopeTasks; 248 Vector<std::unique_ptr<EndOfScopeTask>> m_endOfScopeTasks;
222 std::unique_ptr<ThreadDebugger> m_threadDebugger; 249 std::unique_ptr<ThreadDebugger> m_threadDebugger;
223 250
224 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables; 251 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables;
225 std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor; 252 std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor;
226 }; 253 };
227 254
228 } // namespace blink 255 } // namespace blink
229 256
230 #endif // V8PerIsolateData_h 257 #endif // V8PerIsolateData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698