OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |