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

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

Issue 182903003: Make DOMWrapperWorld::current() callable from workers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/PageScriptDebugServer.cpp ('k') | Source/bindings/v8/V8Binding.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « Source/bindings/v8/PageScriptDebugServer.cpp ('k') | Source/bindings/v8/V8Binding.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698