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

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

Issue 170893003: Revert 167276 "Remove isolatedWorldForEnteredContext() and isola..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 10 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 | « trunk/Source/bindings/v8/DOMWrapperWorld.cpp ('k') | trunk/Source/bindings/v8/V8Binding.h » ('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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 m_isolatedWorlds.set(world->worldId(), isolatedWorldShell.release()) ; 256 m_isolatedWorlds.set(world->worldId(), isolatedWorldShell.release()) ;
257 } 257 }
258 } 258 }
259 if (!shell->isContextInitialized() && shell->initializeIfNeeded()) 259 if (!shell->isContextInitialized() && shell->initializeIfNeeded())
260 m_frame->loader().dispatchDidClearWindowObjectInWorld(world); 260 m_frame->loader().dispatchDidClearWindowObjectInWorld(world);
261 return shell; 261 return shell;
262 } 262 }
263 263
264 bool ScriptController::shouldBypassMainWorldContentSecurityPolicy() 264 bool ScriptController::shouldBypassMainWorldContentSecurityPolicy()
265 { 265 {
266 DOMWrapperWorld* world = DOMWrapperWorld::current(m_isolate); 266 if (DOMWrapperWorld* world = isolatedWorldForEnteredContext(m_isolate))
267 if (world && world->isIsolatedWorld())
268 return world->isolatedWorldHasContentSecurityPolicy(); 267 return world->isolatedWorldHasContentSecurityPolicy();
269 return false; 268 return false;
270 } 269 }
271 270
272 TextPosition ScriptController::eventHandlerPosition() const 271 TextPosition ScriptController::eventHandlerPosition() const
273 { 272 {
274 ScriptableDocumentParser* parser = m_frame->document()->scriptableDocumentPa rser(); 273 ScriptableDocumentParser* parser = m_frame->document()->scriptableDocumentPa rser();
275 if (parser) 274 if (parser)
276 return parser->textPosition(); 275 return parser->textPosition();
277 return TextPosition::minimumPosition(); 276 return TextPosition::minimumPosition();
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 v8Results = evaluateHandleScope.Escape(resultArray); 650 v8Results = evaluateHandleScope.Escape(resultArray);
652 } 651 }
653 652
654 if (results && !v8Results.IsEmpty()) { 653 if (results && !v8Results.IsEmpty()) {
655 for (size_t i = 0; i < v8Results->Length(); ++i) 654 for (size_t i = 0; i < v8Results->Length(); ++i)
656 results->append(ScriptValue(v8Results->Get(i), m_isolate)); 655 results->append(ScriptValue(v8Results->Get(i), m_isolate));
657 } 656 }
658 } 657 }
659 658
660 } // namespace WebCore 659 } // namespace WebCore
OLDNEW
« no previous file with comments | « trunk/Source/bindings/v8/DOMWrapperWorld.cpp ('k') | trunk/Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698