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

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

Issue 2589363003: Use timer task runner for V8PerIsolate tasks (Closed)
Patch Set: One more fix Created 3 years, 12 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 30 matching lines...) Expand all
41 #include <memory> 41 #include <memory>
42 #include <v8.h> 42 #include <v8.h>
43 43
44 namespace blink { 44 namespace blink {
45 45
46 class ActiveScriptWrappableBase; 46 class ActiveScriptWrappableBase;
47 class DOMDataStore; 47 class DOMDataStore;
48 class StringCache; 48 class StringCache;
49 class ThreadDebugger; 49 class ThreadDebugger;
50 class V8PrivateProperty; 50 class V8PrivateProperty;
51 class WebTaskRunner;
51 struct WrapperTypeInfo; 52 struct WrapperTypeInfo;
52 53
53 typedef WTF::Vector<DOMDataStore*> DOMDataStoreList; 54 typedef WTF::Vector<DOMDataStore*> DOMDataStoreList;
54 55
55 class CORE_EXPORT V8PerIsolateData { 56 class CORE_EXPORT V8PerIsolateData {
56 USING_FAST_MALLOC(V8PerIsolateData); 57 USING_FAST_MALLOC(V8PerIsolateData);
57 WTF_MAKE_NONCOPYABLE(V8PerIsolateData); 58 WTF_MAKE_NONCOPYABLE(V8PerIsolateData);
58 59
59 public: 60 public:
60 class EndOfScopeTask { 61 class EndOfScopeTask {
(...skipping 21 matching lines...) Expand all
82 } 83 }
83 ~UseCounterDisabledScope() { 84 ~UseCounterDisabledScope() {
84 m_perIsolateData->m_useCounterDisabled = m_originalUseCounterDisabled; 85 m_perIsolateData->m_useCounterDisabled = m_originalUseCounterDisabled;
85 } 86 }
86 87
87 private: 88 private:
88 V8PerIsolateData* m_perIsolateData; 89 V8PerIsolateData* m_perIsolateData;
89 const bool m_originalUseCounterDisabled; 90 const bool m_originalUseCounterDisabled;
90 }; 91 };
91 92
92 static v8::Isolate* initialize(); 93 static v8::Isolate* initialize(WebTaskRunner*);
93 94
94 static V8PerIsolateData* from(v8::Isolate* isolate) { 95 static V8PerIsolateData* from(v8::Isolate* isolate) {
95 ASSERT(isolate); 96 ASSERT(isolate);
96 ASSERT(isolate->GetData(gin::kEmbedderBlink)); 97 ASSERT(isolate->GetData(gin::kEmbedderBlink));
97 return static_cast<V8PerIsolateData*>( 98 return static_cast<V8PerIsolateData*>(
98 isolate->GetData(gin::kEmbedderBlink)); 99 isolate->GetData(gin::kEmbedderBlink));
99 } 100 }
100 101
101 static void willBeDestroyed(v8::Isolate*); 102 static void willBeDestroyed(v8::Isolate*);
102 static void destroy(v8::Isolate*); 103 static void destroy(v8::Isolate*);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 169
169 void setScriptWrappableVisitor( 170 void setScriptWrappableVisitor(
170 std::unique_ptr<ScriptWrappableVisitor> visitor) { 171 std::unique_ptr<ScriptWrappableVisitor> visitor) {
171 m_scriptWrappableVisitor = std::move(visitor); 172 m_scriptWrappableVisitor = std::move(visitor);
172 } 173 }
173 ScriptWrappableVisitor* scriptWrappableVisitor() { 174 ScriptWrappableVisitor* scriptWrappableVisitor() {
174 return m_scriptWrappableVisitor.get(); 175 return m_scriptWrappableVisitor.get();
175 } 176 }
176 177
177 private: 178 private:
178 V8PerIsolateData(); 179 explicit V8PerIsolateData(WebTaskRunner*);
179 ~V8PerIsolateData(); 180 ~V8PerIsolateData();
180 181
181 static void useCounterCallback(v8::Isolate*, v8::Isolate::UseCounterFeature); 182 static void useCounterCallback(v8::Isolate*, v8::Isolate::UseCounterFeature);
182 183
183 typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate>> 184 typedef HashMap<const void*, v8::Eternal<v8::FunctionTemplate>>
184 V8FunctionTemplateMap; 185 V8FunctionTemplateMap;
185 V8FunctionTemplateMap& selectInterfaceTemplateMap(const DOMWrapperWorld&); 186 V8FunctionTemplateMap& selectInterfaceTemplateMap(const DOMWrapperWorld&);
186 V8FunctionTemplateMap& selectOperationTemplateMap(const DOMWrapperWorld&); 187 V8FunctionTemplateMap& selectOperationTemplateMap(const DOMWrapperWorld&);
187 bool hasInstance(const WrapperTypeInfo* untrusted, 188 bool hasInstance(const WrapperTypeInfo* untrusted,
188 v8::Local<v8::Value>, 189 v8::Local<v8::Value>,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 Vector<std::unique_ptr<EndOfScopeTask>> m_endOfScopeTasks; 221 Vector<std::unique_ptr<EndOfScopeTask>> m_endOfScopeTasks;
221 std::unique_ptr<ThreadDebugger> m_threadDebugger; 222 std::unique_ptr<ThreadDebugger> m_threadDebugger;
222 223
223 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables; 224 Persistent<ActiveScriptWrappableSet> m_activeScriptWrappables;
224 std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor; 225 std::unique_ptr<ScriptWrappableVisitor> m_scriptWrappableVisitor;
225 }; 226 };
226 227
227 } // namespace blink 228 } // namespace blink
228 229
229 #endif // V8PerIsolateData_h 230 #endif // V8PerIsolateData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698