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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h

Issue 2747163002: Bindings: Manage multiple DOMWrapperWorlds for worklets (2) (Closed)
Patch Set: address review comments & may fix use-after-free bug in the test Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h
index d4821bd4ed988205ae3ba5aa9fc58157bf9c0e9f..7dba1dd17235678b8232ab00e7c21af7802fd0ab 100644
--- a/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h
+++ b/third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.h
@@ -84,10 +84,13 @@ class CORE_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
~DOMWrapperWorld();
void dispose();
- static bool nonMainWorldsInMainThread() {
+ // Called from performance-sensitive functions, so we should keep this simple
+ // and fast as much as possible.
+ static bool nonMainWorldsExistInMainThread() {
return s_numberOfNonMainWorldsInMainThread;
}
- static void allWorldsInMainThread(Vector<RefPtr<DOMWrapperWorld>>& worlds);
+
+ static void allWorldsInCurrentThread(Vector<RefPtr<DOMWrapperWorld>>& worlds);
static void markWrappersInAllWorlds(ScriptWrappable*,
const ScriptWrappableVisitor*);
@@ -99,7 +102,6 @@ class CORE_EXPORT DOMWrapperWorld : public RefCounted<DOMWrapperWorld> {
return world(isolate->GetCurrentContext());
}
- static DOMWrapperWorld*& workerWorld();
static DOMWrapperWorld& mainWorld();
static PassRefPtr<DOMWrapperWorld> fromWorldId(v8::Isolate*, int worldId);

Powered by Google App Engine
This is Rietveld 408576698