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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 m_isolatedWorlds.set(world->worldId(), isolatedWorldShell.release())
; | 255 m_isolatedWorlds.set(world->worldId(), isolatedWorldShell.release())
; |
256 } | 256 } |
257 } | 257 } |
258 if (!shell->isContextInitialized() && shell->initializeIfNeeded()) | 258 if (!shell->isContextInitialized() && shell->initializeIfNeeded()) |
259 m_frame->loader().dispatchDidClearWindowObjectInWorld(world); | 259 m_frame->loader().dispatchDidClearWindowObjectInWorld(world); |
260 return shell; | 260 return shell; |
261 } | 261 } |
262 | 262 |
263 bool ScriptController::shouldBypassMainWorldContentSecurityPolicy() | 263 bool ScriptController::shouldBypassMainWorldContentSecurityPolicy() |
264 { | 264 { |
| 265 v8::Handle<v8::Context> context = m_isolate->GetCurrentContext(); |
| 266 if (context.IsEmpty() || !toDOMWindow(context)) |
| 267 return false; |
265 DOMWrapperWorld* world = DOMWrapperWorld::current(m_isolate); | 268 DOMWrapperWorld* world = DOMWrapperWorld::current(m_isolate); |
266 if (world && world->isIsolatedWorld()) | 269 return world->isIsolatedWorld() ? world->isolatedWorldHasContentSecurityPoli
cy() : false; |
267 return world->isolatedWorldHasContentSecurityPolicy(); | |
268 return false; | |
269 } | 270 } |
270 | 271 |
271 TextPosition ScriptController::eventHandlerPosition() const | 272 TextPosition ScriptController::eventHandlerPosition() const |
272 { | 273 { |
273 ScriptableDocumentParser* parser = m_frame->document()->scriptableDocumentPa
rser(); | 274 ScriptableDocumentParser* parser = m_frame->document()->scriptableDocumentPa
rser(); |
274 if (parser) | 275 if (parser) |
275 return parser->textPosition(); | 276 return parser->textPosition(); |
276 return TextPosition::minimumPosition(); | 277 return TextPosition::minimumPosition(); |
277 } | 278 } |
278 | 279 |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 v8Results = evaluateHandleScope.Escape(resultArray); | 650 v8Results = evaluateHandleScope.Escape(resultArray); |
650 } | 651 } |
651 | 652 |
652 if (results && !v8Results.IsEmpty()) { | 653 if (results && !v8Results.IsEmpty()) { |
653 for (size_t i = 0; i < v8Results->Length(); ++i) | 654 for (size_t i = 0; i < v8Results->Length(); ++i) |
654 results->append(ScriptValue(v8Results->Get(i), m_isolate)); | 655 results->append(ScriptValue(v8Results->Get(i), m_isolate)); |
655 } | 656 } |
656 } | 657 } |
657 | 658 |
658 } // namespace WebCore | 659 } // namespace WebCore |
OLD | NEW |