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

Side by Side Diff: Source/bindings/v8/ScriptController.cpp

Issue 146693005: Clarify when what notifications are send when a window object is cleared (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 else { 231 else {
232 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId()) ; 232 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world.worldId()) ;
233 if (iter != m_isolatedWorlds.end()) 233 if (iter != m_isolatedWorlds.end())
234 shell = iter->value.get(); 234 shell = iter->value.get();
235 else { 235 else {
236 OwnPtr<V8WindowShell> isolatedWorldShell = V8WindowShell::create(m_f rame, world, m_isolate); 236 OwnPtr<V8WindowShell> isolatedWorldShell = V8WindowShell::create(m_f rame, world, m_isolate);
237 shell = isolatedWorldShell.get(); 237 shell = isolatedWorldShell.get();
238 m_isolatedWorlds.set(world.worldId(), isolatedWorldShell.release()); 238 m_isolatedWorlds.set(world.worldId(), isolatedWorldShell.release());
239 } 239 }
240 } 240 }
241 if (!shell->isContextInitialized() && shell->initializeIfNeeded()) 241 if (!shell->isContextInitialized() && shell->initializeIfNeeded() && world.i sMainWorld())
242 m_frame->loader().dispatchDidClearWindowObjectInWorld(world); 242 m_frame->loader().dispatchDidClearWindowObjectInMainWorld();
243 return shell; 243 return shell;
244 } 244 }
245 245
246 bool ScriptController::shouldBypassMainWorldContentSecurityPolicy() 246 bool ScriptController::shouldBypassMainWorldContentSecurityPolicy()
247 { 247 {
248 v8::Handle<v8::Context> context = m_isolate->GetCurrentContext(); 248 v8::Handle<v8::Context> context = m_isolate->GetCurrentContext();
249 if (context.IsEmpty() || !toDOMWindow(context)) 249 if (context.IsEmpty() || !toDOMWindow(context))
250 return false; 250 return false;
251 DOMWrapperWorld& world = DOMWrapperWorld::current(m_isolate); 251 DOMWrapperWorld& world = DOMWrapperWorld::current(m_isolate);
252 return world.isIsolatedWorld() ? world.isolatedWorldHasContentSecurityPolicy () : false; 252 return world.isIsolatedWorld() ? world.isolatedWorldHasContentSecurityPolicy () : false;
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 resultArray->Set(i, evaluationResult); 627 resultArray->Set(i, evaluationResult);
628 } 628 }
629 629
630 if (results) { 630 if (results) {
631 for (size_t i = 0; i < resultArray->Length(); ++i) 631 for (size_t i = 0; i < resultArray->Length(); ++i)
632 results->append(ScriptValue(ScriptState::from(context), resultArray- >Get(i))); 632 results->append(ScriptValue(ScriptState::from(context), resultArray- >Get(i)));
633 } 633 }
634 } 634 }
635 635
636 } // namespace WebCore 636 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InspectorController.h » ('j') | Source/core/loader/FrameLoader.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698