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

Unified Diff: trunk/Source/bindings/v8/ScriptController.cpp

Issue 218813002: Revert 170357 "Revert of Make DOMWrapperWorld::current() return ..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 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
« no previous file with comments | « trunk/Source/bindings/v8/ScriptController.h ('k') | trunk/Source/bindings/v8/ScriptPreprocessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/bindings/v8/ScriptController.cpp
===================================================================
--- trunk/Source/bindings/v8/ScriptController.cpp (revision 170423)
+++ trunk/Source/bindings/v8/ScriptController.cpp (working copy)
@@ -209,34 +209,30 @@
return windowShell(DOMWrapperWorld::mainWorld())->isContextInitialized();
}
-V8WindowShell* ScriptController::existingWindowShell(DOMWrapperWorld* world)
+V8WindowShell* ScriptController::existingWindowShell(DOMWrapperWorld& world)
{
- ASSERT(world);
-
- if (world->isMainWorld())
+ if (world.isMainWorld())
return m_windowShell->isContextInitialized() ? m_windowShell.get() : 0;
- IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world->worldId());
+ IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId());
if (iter == m_isolatedWorlds.end())
return 0;
return iter->value->isContextInitialized() ? iter->value.get() : 0;
}
-V8WindowShell* ScriptController::windowShell(DOMWrapperWorld* world)
+V8WindowShell* ScriptController::windowShell(DOMWrapperWorld& world)
{
- ASSERT(world);
-
V8WindowShell* shell = 0;
- if (world->isMainWorld())
+ if (world.isMainWorld())
shell = m_windowShell.get();
else {
- IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world->worldId());
+ IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId());
if (iter != m_isolatedWorlds.end())
shell = iter->value.get();
else {
OwnPtr<V8WindowShell> isolatedWorldShell = V8WindowShell::create(m_frame, world, m_isolate);
shell = isolatedWorldShell.get();
- m_isolatedWorlds.set(world->worldId(), isolatedWorldShell.release());
+ m_isolatedWorlds.set(world.worldId(), isolatedWorldShell.release());
}
}
if (!shell->isContextInitialized() && shell->initializeIfNeeded())
@@ -249,8 +245,8 @@
v8::Handle<v8::Context> context = m_isolate->GetCurrentContext();
if (context.IsEmpty() || !toDOMWindow(context))
return false;
- DOMWrapperWorld* world = DOMWrapperWorld::current(m_isolate);
- return world->isIsolatedWorld() ? world->isolatedWorldHasContentSecurityPolicy() : false;
+ DOMWrapperWorld& world = DOMWrapperWorld::current(m_isolate);
+ return world.isIsolatedWorld() ? world.isolatedWorldHasContentSecurityPolicy() : false;
}
TextPosition ScriptController::eventHandlerPosition() const
@@ -449,7 +445,7 @@
v8::HandleScope handleScope(m_isolate);
for (IsolatedWorldMap::iterator it = m_isolatedWorlds.begin(); it != m_isolatedWorlds.end(); ++it) {
V8WindowShell* isolatedWorldShell = it->value.get();
- SecurityOrigin* origin = isolatedWorldShell->world()->isolatedWorldSecurityOrigin();
+ SecurityOrigin* origin = isolatedWorldShell->world().isolatedWorldSecurityOrigin();
if (!origin)
continue;
v8::Local<v8::Context> v8Context = isolatedWorldShell->context();
@@ -615,7 +611,7 @@
{
v8::EscapableHandleScope evaluateHandleScope(m_isolate);
RefPtr<DOMWrapperWorld> world = DOMWrapperWorld::ensureIsolatedWorld(worldID, extensionGroup);
- V8WindowShell* isolatedWorldShell = windowShell(world.get());
+ V8WindowShell* isolatedWorldShell = windowShell(*world);
if (!isolatedWorldShell->isContextInitialized())
return;
« no previous file with comments | « trunk/Source/bindings/v8/ScriptController.h ('k') | trunk/Source/bindings/v8/ScriptPreprocessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698