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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/DOMWrapperWorld.cpp

Issue 1615523002: Transitively keep track of an isolated world's children scripts and worlds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use a static world stack instead of a per-world private field Created 4 years, 10 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 void DOMWrapperWorld::allWorldsInMainThread(Vector<RefPtr<DOMWrapperWorld>>& wor lds) 131 void DOMWrapperWorld::allWorldsInMainThread(Vector<RefPtr<DOMWrapperWorld>>& wor lds)
132 { 132 {
133 ASSERT(isMainThread()); 133 ASSERT(isMainThread());
134 worlds.append(&mainWorld()); 134 worlds.append(&mainWorld());
135 WorldMap& isolatedWorlds = isolatedWorldMap(); 135 WorldMap& isolatedWorlds = isolatedWorldMap();
136 for (WorldMap::iterator it = isolatedWorlds.begin(); it != isolatedWorlds.en d(); ++it) 136 for (WorldMap::iterator it = isolatedWorlds.begin(); it != isolatedWorlds.en d(); ++it)
137 worlds.append(it->value); 137 worlds.append(it->value);
138 } 138 }
139 139
140 Vector<RefPtr<DOMWrapperWorld>>& DOMWrapperWorld::originWorldStack()
141 {
142 ASSERT(isMainThread());
143 DEFINE_STATIC_LOCAL(Vector<RefPtr<DOMWrapperWorld>>, worldStack, ());
144 return worldStack;
145 }
146
140 DOMWrapperWorld::~DOMWrapperWorld() 147 DOMWrapperWorld::~DOMWrapperWorld()
141 { 148 {
142 ASSERT(!isMainWorld()); 149 ASSERT(!isMainWorld());
143 150
144 dispose(); 151 dispose();
145 152
146 if (!isIsolatedWorld()) 153 if (!isIsolatedWorld())
147 return; 154 return;
148 155
149 WorldMap& map = isolatedWorldMap(); 156 WorldMap& map = isolatedWorldMap();
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 m_domObjectHolders.remove(holderBase); 289 m_domObjectHolders.remove(holderBase);
283 } 290 }
284 291
285 void DOMWrapperWorld::weakCallbackForDOMObjectHolder(const v8::WeakCallbackInfo< DOMObjectHolderBase>& data) 292 void DOMWrapperWorld::weakCallbackForDOMObjectHolder(const v8::WeakCallbackInfo< DOMObjectHolderBase>& data)
286 { 293 {
287 DOMObjectHolderBase* holderBase = data.GetParameter(); 294 DOMObjectHolderBase* holderBase = data.GetParameter();
288 holderBase->world()->unregisterDOMObjectHolder(holderBase); 295 holderBase->world()->unregisterDOMObjectHolder(holderBase);
289 } 296 }
290 297
291 } // namespace blink 298 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698