Changeset 128159 in webkit
- Timestamp:
- Sep 11, 2012 2:35:13 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 deleted
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r128156 r128159 1 2012-09-11 Dan Carney <dcarney@google.com> 2 3 Removed V8IsolatedContext 4 https://bugs.webkit.org/show_bug.cgi?id=95735 5 6 Reviewed by Adam Barth. 7 8 Remove V8IsolatedContext and merge functionality into V8DOMWindowShell. 9 This brings the V8 isolated world model into closer alignment with 10 that of JSC. 11 12 No new tests. No change in functionality. 13 14 * UseV8.cmake: 15 * WebCore.gypi: 16 * bindings/scripts/CodeGeneratorV8.pm: 17 (GenerateImplementation): 18 * bindings/scripts/test/V8/V8Float64Array.cpp: 19 * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: 20 * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp: 21 * bindings/scripts/test/V8/V8TestEventConstructor.cpp: 22 * bindings/scripts/test/V8/V8TestEventTarget.cpp: 23 * bindings/scripts/test/V8/V8TestException.cpp: 24 * bindings/scripts/test/V8/V8TestInterface.cpp: 25 * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp: 26 * bindings/scripts/test/V8/V8TestNamedConstructor.cpp: 27 * bindings/scripts/test/V8/V8TestNode.cpp: 28 * bindings/scripts/test/V8/V8TestObj.cpp: 29 * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp: 30 * bindings/v8/DOMData.cpp: 31 (WebCore::DOMData::getCurrentStore): 32 * bindings/v8/DOMWrapperWorld.cpp: 33 (WebCore::DOMWrapperWorld::ensureIsolatedWorld): 34 * bindings/v8/DOMWrapperWorld.h: 35 (DOMWrapperWorld): 36 * bindings/v8/ScriptController.cpp: 37 (WebCore::ScriptController::ScriptController): 38 (WebCore::ScriptController::resetIsolatedWorlds): 39 (WebCore::ScriptController::ensureIsolatedWorldContext): 40 (WebCore::ScriptController::existingWindowShellInternal): 41 (WebCore): 42 (WebCore::ScriptController::windowShell): 43 (WebCore::ScriptController::evaluateInIsolatedWorld): 44 (WebCore::ScriptController::setIsolatedWorldSecurityOrigin): 45 (WebCore::ScriptController::currentWorldContext): 46 (WebCore::ScriptController::evaluateInWorld): 47 (WebCore::ScriptController::collectIsolatedContexts): 48 * bindings/v8/ScriptController.h: 49 (WebCore): 50 (ScriptController): 51 (WebCore::ScriptController::existingWindowShell): 52 * bindings/v8/SharedPersistent.h: 53 (WebCore): 54 (WebCore::SharedPersistent::create): 55 (WebCore::SharedPersistent::get): 56 (WebCore::SharedPersistent::SharedPersistent): 57 (SharedPersistent): 58 * bindings/v8/V8Binding.cpp: 59 (WebCore::perContextDataForCurrentWorld): 60 * bindings/v8/V8DOMWindowShell.cpp: 61 (WebCore::setIsolatedWorldField): 62 (WebCore::V8DOMWindowShell::enteredIsolatedWorldContext): 63 (WebCore): 64 (WebCore::setInjectedScriptContextDebugId): 65 (WebCore::V8DOMWindowShell::create): 66 (WebCore::V8DOMWindowShell::V8DOMWindowShell): 67 (WebCore::V8DOMWindowShell::destroyIsolatedShell): 68 (WebCore::isolatedContextWeakCallback): 69 (WebCore::V8DOMWindowShell::disposeContext): 70 (WebCore::V8DOMWindowShell::initializeIfNeeded): 71 (WebCore::V8DOMWindowShell::createContext): 72 (WebCore::V8DOMWindowShell::installDOMWindow): 73 (WebCore::V8DOMWindowShell::updateDocumentWrapper): 74 (WebCore::V8DOMWindowShell::updateDocumentProperty): 75 (WebCore::V8DOMWindowShell::clearDocumentProperty): 76 (WebCore::V8DOMWindowShell::setSecurityToken): 77 (WebCore::V8DOMWindowShell::updateDocument): 78 (WebCore::V8DOMWindowShell::namedItemAdded): 79 (WebCore::V8DOMWindowShell::namedItemRemoved): 80 (WebCore::V8DOMWindowShell::updateSecurityOrigin): 81 (WebCore::V8DOMWindowShell::setIsolatedWorldSecurityOrigin): 82 * bindings/v8/V8DOMWindowShell.h: 83 (V8DOMWindowShell): 84 (WebCore::V8DOMWindowShell::world): 85 (WebCore::V8DOMWindowShell::isolatedWorldSecurityOrigin): 86 (WebCore::V8DOMWindowShell::getEntered): 87 * bindings/v8/V8DOMWrapper.h: 88 (WebCore::V8DOMWrapper::getCachedWrapper): 89 * bindings/v8/V8IsolatedContext.cpp: Removed. 90 * bindings/v8/V8IsolatedContext.h: Removed. 91 * bindings/v8/V8LazyEventListener.cpp: 92 * bindings/v8/WorldContextHandle.cpp: 93 (WebCore::WorldContextHandle::WorldContextHandle): 94 (WebCore::WorldContextHandle::adjustedContext): 95 * bindings/v8/custom/V8DocumentCustom.cpp: 96 (WebCore::toV8): 97 * bindings/v8/custom/V8HTMLDocumentCustom.cpp: 98 (WebCore::toV8): 99 * bindings/v8/custom/V8SVGDocumentCustom.cpp: 100 (WebCore::toV8): 101 * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp: 102 (WebCore::V8XMLHttpRequest::constructorCallback): 103 1 104 2012-09-11 Keishi Hattori <keishi@webkit.org> 2 105 -
trunk/Source/WebCore/UseV8.cmake
r127249 r128159 58 58 bindings/v8/V8GCForContextDispose.cpp 59 59 bindings/v8/V8HiddenPropertyName.cpp 60 bindings/v8/V8IsolatedContext.cpp61 60 bindings/v8/V8LazyEventListener.cpp 62 61 bindings/v8/V8NodeFilterCondition.cpp -
trunk/Source/WebCore/WebCore.gypi
r128153 r128159 2302 2302 'bindings/v8/V8HiddenPropertyName.cpp', 2303 2303 'bindings/v8/V8HiddenPropertyName.h', 2304 'bindings/v8/V8IsolatedContext.cpp',2305 'bindings/v8/V8IsolatedContext.h',2306 2304 'bindings/v8/V8LazyEventListener.cpp', 2307 2305 'bindings/v8/V8LazyEventListener.h', -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r128139 r128159 2520 2520 AddToImplIncludes("V8Binding.h"); 2521 2521 AddToImplIncludes("V8DOMWrapper.h"); 2522 AddToImplIncludes("V8IsolatedContext.h");2523 2522 2524 2523 AddIncludesForType($interfaceName); -
trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
r127972 r128159 33 33 #include "V8Float32Array.h" 34 34 #include "V8Int32Array.h" 35 #include "V8IsolatedContext.h"36 35 #include <wtf/Float32Array.h> 37 36 #include <wtf/Float64Array.h> -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
r127972 r128159 29 29 #include "V8Binding.h" 30 30 #include "V8DOMWrapper.h" 31 #include "V8IsolatedContext.h"32 31 #include "V8Node.h" 33 32 #include <wtf/UnusedParam.h> -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
r127972 r128159 29 29 #include "V8Binding.h" 30 30 #include "V8DOMWrapper.h" 31 #include "V8IsolatedContext.h"32 31 #include <wtf/UnusedParam.h> 33 32 -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
r127972 r128159 29 29 #include "V8Binding.h" 30 30 #include "V8DOMWrapper.h" 31 #include "V8IsolatedContext.h"32 31 #include <wtf/UnusedParam.h> 33 32 -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
r127972 r128159 31 31 #include "V8DOMWrapper.h" 32 32 #include "V8Event.h" 33 #include "V8IsolatedContext.h"34 33 #include "V8Node.h" 35 34 #include <wtf/UnusedParam.h> -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp
r127972 r128159 28 28 #include "V8Binding.h" 29 29 #include "V8DOMWrapper.h" 30 #include "V8IsolatedContext.h"31 30 #include <wtf/UnusedParam.h> 32 31 -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
r128139 r128159 32 32 #include "V8Binding.h" 33 33 #include "V8DOMWrapper.h" 34 #include "V8IsolatedContext.h"35 34 #include "V8Node.h" 36 35 #include "V8TestObj.h" -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
r127972 r128159 30 30 #include "V8Binding.h" 31 31 #include "V8DOMWrapper.h" 32 #include "V8IsolatedContext.h"33 32 #include <wtf/UnusedParam.h> 34 33 -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
r128094 r128159 29 29 #include "V8Binding.h" 30 30 #include "V8DOMWrapper.h" 31 #include "V8IsolatedContext.h"32 31 #include <wtf/UnusedParam.h> 33 32 -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp
r127972 r128159 28 28 #include "V8Binding.h" 29 29 #include "V8DOMWrapper.h" 30 #include "V8IsolatedContext.h"31 30 #include "V8Node.h" 32 31 #include <wtf/UnusedParam.h> -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r128139 r128159 44 44 #include "V8Document.h" 45 45 #include "V8Float32Array.h" 46 #include "V8IsolatedContext.h"47 46 #include "V8SVGDocument.h" 48 47 #include "V8SVGPoint.h" -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
r127972 r128159 33 33 #include "V8Binding.h" 34 34 #include "V8DOMWrapper.h" 35 #include "V8IsolatedContext.h"36 35 #include "V8MessagePort.h" 37 36 #include <wtf/ArrayBuffer.h> -
trunk/Source/WebCore/bindings/v8/DOMData.cpp
r125216 r128159 32 32 #include "DOMData.h" 33 33 #include "V8Binding.h" 34 #include "V8 IsolatedContext.h"34 #include "V8DOMWindowShell.h" 35 35 #include "WebGLContextAttributes.h" 36 36 #include "WebGLUniformLocation.h" … … 44 44 if (UNLIKELY(data->domDataStore() != 0)) 45 45 return *data->domDataStore(); 46 V8 IsolatedContext* context = V8IsolatedContext::getEntered();46 V8DOMWindowShell* context = V8DOMWindowShell::getEntered(); 47 47 if (UNLIKELY(context != 0)) 48 48 return *context->world()->domDataStore(); -
trunk/Source/WebCore/bindings/v8/DOMWrapperWorld.cpp
r126926 r128159 91 91 static int temporaryWorldId = DOMWrapperWorld::uninitializedWorldId-1; 92 92 93 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld:: getOrCreateIsolatedWorld(int worldId, int extensionGroup)93 PassRefPtr<DOMWrapperWorld> DOMWrapperWorld::ensureIsolatedWorld(int worldId, int extensionGroup) 94 94 { 95 95 ASSERT(worldId != mainWorldId); 96 ASSERT(worldId != uninitializedWorldId);97 96 98 97 WorldMap& map = isolatedWorldMap(); 99 if ( !worldId)98 if (worldId == uninitializedWorldId) 100 99 worldId = temporaryWorldId--; 101 100 else { -
trunk/Source/WebCore/bindings/v8/DOMWrapperWorld.h
r126566 r128159 42 42 class DOMWrapperWorld : public WTF::RefCountedBase { 43 43 public: 44 static const int mainWorldId = -1;45 static const int mainWorldExtensionGroup = -1;46 static const int uninitializedWorldId = - 2;47 static const int uninitializedExtensionGroup = - 2;44 static const int mainWorldId = 0; 45 static const int mainWorldExtensionGroup = 0; 46 static const int uninitializedWorldId = -1; 47 static const int uninitializedExtensionGroup = -1; 48 48 // If 0 is passed as worldId, the world will be assigned a temporary id instead. 49 static PassRefPtr<DOMWrapperWorld> getOrCreateIsolatedWorld(int worldId, int extensionGroup);49 static PassRefPtr<DOMWrapperWorld> ensureIsolatedWorld(int worldId, int extensionGroup); 50 50 static bool isolatedWorldsExist() { return isolatedWorldCount; } 51 51 // FIXME: this is a workaround for a problem in WebViewImpl. -
trunk/Source/WebCore/bindings/v8/ScriptController.cpp
r128123 r128159 63 63 #include "V8HiddenPropertyName.h" 64 64 #include "V8HTMLEmbedElement.h" 65 #include "V8IsolatedContext.h"66 65 #include "V8NPObject.h" 67 66 #include "V8RecursionScope.h" … … 101 100 : m_frame(frame) 102 101 , m_sourceURL(0) 103 , m_windowShell(V8DOMWindowShell::create(frame ))102 , m_windowShell(V8DOMWindowShell::create(frame, mainThreadNormalWorld())) 104 103 , m_paused(false) 105 104 #if ENABLE(NETSCAPE_PLUGIN_API) … … 148 147 for (IsolatedWorldMap::iterator iter = m_isolatedWorlds.begin(); 149 148 iter != m_isolatedWorlds.end(); ++iter) { 150 iter->second->destroy ();149 iter->second->destroyIsolatedShell(); 151 150 } 152 151 m_isolatedWorlds.clear(); … … 315 314 } 316 315 317 void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>& sources, Vector<ScriptValue>* results) 318 { 319 evaluateInIsolatedWorld(worldID, sources, 0, results); 320 } 321 322 void ScriptController::evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup, Vector<ScriptValue>* results) 323 { 316 V8DOMWindowShell* ScriptController::ensureIsolatedWorldContext(int worldId, int extensionGroup) 317 { 318 ASSERT(worldId != DOMWrapperWorld::mainWorldId); 319 320 // Check the map for non-temporary worlds. 321 if (worldId != DOMWrapperWorld::uninitializedWorldId) { 322 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(worldId); 323 if (iter != m_isolatedWorlds.end()) { 324 ASSERT(iter->second->world()->worldId() == worldId); 325 ASSERT(iter->second->world()->extensionGroup() == extensionGroup); 326 return iter->second; 327 } 328 } 329 330 RefPtr<DOMWrapperWorld> world = DOMWrapperWorld::ensureIsolatedWorld(worldId, extensionGroup); 331 OwnPtr<V8DOMWindowShell> isolatedWorldShell = V8DOMWindowShell::create(m_frame, world); 332 m_isolatedWorlds.set(world->worldId(), isolatedWorldShell.get()); 333 return isolatedWorldShell.leakPtr(); 334 } 335 336 V8DOMWindowShell* ScriptController::existingWindowShellInternal(DOMWrapperWorld* world) 337 { 338 ASSERT(world); 339 340 if (LIKELY(world->isMainWorld())) 341 return m_windowShell.get(); 342 343 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(world->worldId()); 344 return iter == m_isolatedWorlds.end() ? 0 : iter->second; 345 } 346 347 V8DOMWindowShell* ScriptController::windowShell(DOMWrapperWorld* world) 348 { 349 V8DOMWindowShell* shell = existingWindowShellInternal(world); 350 if (LIKELY(!!shell)) 351 return shell; 352 353 OwnPtr<V8DOMWindowShell> isolatedWorldShell = V8DOMWindowShell::create(m_frame, world); 354 m_isolatedWorlds.set(world->worldId(), isolatedWorldShell.get()); 355 return isolatedWorldShell.leakPtr(); 356 } 357 358 void ScriptController::evaluateInIsolatedWorld(int worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup, Vector<ScriptValue>* results) 359 { 360 // Except in the test runner, worldID should be non 0 as it conflicts with the mainWorldId. 361 // FIXME: Change the test runner to perform this swap and make this an ASSERT. 362 if (UNLIKELY(!worldID)) 363 worldID = DOMWrapperWorld::uninitializedWorldId; 364 324 365 v8::HandleScope handleScope; 325 326 // FIXME: This will need to get reorganized once we have a windowShell for the isolated world.327 if (!windowShell()->initializeIfNeeded())328 return;329 330 366 v8::Local<v8::Array> v8Results; 331 367 { 332 368 v8::HandleScope evaluateHandleScope; 333 V8IsolatedContext* isolatedContext = 0; 334 if (worldID > 0) { 335 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(worldID); 336 if (iter != m_isolatedWorlds.end()) 337 isolatedContext = iter->second; 338 else { 339 isolatedContext = new V8IsolatedContext(m_frame, DOMWrapperWorld::getOrCreateIsolatedWorld(worldID, extensionGroup)); 340 if (isolatedContext->context().IsEmpty()) { 341 delete isolatedContext; 342 return; 343 } 344 345 // FIXME: We should change this to using window shells to match JSC. 346 m_isolatedWorlds.set(worldID, isolatedContext); 347 } 348 369 V8DOMWindowShell* isolatedWorldShell = ensureIsolatedWorldContext(worldID, extensionGroup); 370 371 if (worldID != DOMWrapperWorld::uninitializedWorldId) { 349 372 IsolatedWorldSecurityOriginMap::iterator securityOriginIter = m_isolatedWorldSecurityOrigins.find(worldID); 350 373 if (securityOriginIter != m_isolatedWorldSecurityOrigins.end()) 351 isolatedContext->setSecurityOrigin(securityOriginIter->second); 352 } else { 353 isolatedContext = new V8IsolatedContext(m_frame, DOMWrapperWorld::getOrCreateIsolatedWorld(worldID, extensionGroup)); 354 if (isolatedContext->context().IsEmpty()) { 355 delete isolatedContext; 356 return; 357 } 374 isolatedWorldShell->setIsolatedWorldSecurityOrigin(securityOriginIter->second); 358 375 } 359 376 360 v8::Local<v8::Context> context = v8::Local<v8::Context>::New(isolatedContext->context()); 377 isolatedWorldShell->initializeIfNeeded(); 378 if (isolatedWorldShell->context().IsEmpty()) 379 return; 380 381 v8::Local<v8::Context> context = v8::Local<v8::Context>::New(isolatedWorldShell->context()); 361 382 v8::Context::Scope contextScope(context); 362 383 v8::Local<v8::Array> resultArray = v8::Array::New(sources.size()); … … 369 390 } 370 391 371 if (!worldID) 372 isolatedContext->destroy(); 392 // Mark temporary shell for weak destruction. 393 if (worldID == DOMWrapperWorld::uninitializedWorldId) { 394 int actualWorldId = isolatedWorldShell->world()->worldId(); 395 m_isolatedWorlds.remove(actualWorldId); 396 isolatedWorldShell->destroyIsolatedShell(); 397 } 373 398 374 399 v8Results = evaluateHandleScope.Close(resultArray); … … 387 412 IsolatedWorldMap::iterator iter = m_isolatedWorlds.find(worldID); 388 413 if (iter != m_isolatedWorlds.end()) 389 iter->second->set SecurityOrigin(securityOrigin);414 iter->second->setIsolatedWorldSecurityOrigin(securityOrigin); 390 415 } 391 416 … … 404 429 v8::Local<v8::Context> ScriptController::currentWorldContext() 405 430 { 406 if (V8 IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) {407 RefPtr<SharedPersistent<v8::Context> > context = isolatedContext->sharedContext();408 if ( m_frame != toFrameIfNotDetached(context->get()))431 if (V8DOMWindowShell* isolatedShell = V8DOMWindowShell::getEntered()) { 432 v8::Persistent<v8::Context> context = isolatedShell->context(); 433 if (context.IsEmpty() || m_frame != toFrameIfNotDetached(context)) 409 434 return v8::Local<v8::Context>(); 410 return v8::Local<v8::Context>::New(context ->get());435 return v8::Local<v8::Context>::New(context); 411 436 } 412 437 windowShell()->initializeIfNeeded(); … … 533 558 DOMWrapperWorld* world) 534 559 { 560 if (world == mainThreadNormalWorld()) { 561 evaluate(source); 562 return; 563 } 535 564 Vector<ScriptSourceCode> sources; 536 565 sources.append(source); 537 // FIXME: Get an ID from the world param. 538 evaluateInIsolatedWorld(0, sources, 0); 566 evaluateInIsolatedWorld(world->worldId(), sources, world->extensionGroup(), 0); 539 567 } 540 568 … … 637 665 v8::HandleScope handleScope; 638 666 for (IsolatedWorldMap::iterator it = m_isolatedWorlds.begin(); it != m_isolatedWorlds.end(); ++it) { 639 V8 IsolatedContext* isolatedContext= it->second;640 if (!isolated Context->securityOrigin())667 V8DOMWindowShell* isolatedWorldShell = it->second; 668 if (!isolatedWorldShell->isolatedWorldSecurityOrigin()) 641 669 continue; 642 v8::Handle<v8::Context> v8Context = isolated Context->context();670 v8::Handle<v8::Context> v8Context = isolatedWorldShell->context(); 643 671 if (v8Context.IsEmpty()) 644 672 continue; 645 673 ScriptState* scriptState = ScriptState::forContext(v8::Local<v8::Context>::New(v8Context)); 646 result.append(std::pair<ScriptState*, SecurityOrigin*>(scriptState, isolated Context->securityOrigin()));674 result.append(std::pair<ScriptState*, SecurityOrigin*>(scriptState, isolatedWorldShell->isolatedWorldSecurityOrigin())); 647 675 } 648 676 } -
trunk/Source/WebCore/bindings/v8/ScriptController.h
r128123 r128159 58 58 class SecurityOrigin; 59 59 class V8DOMWindowShell; 60 class V8IsolatedContext;61 60 class Widget; 62 63 // Note: although the pointer is raw, the instance is kept alive by a strong64 // reference to the v8 context it contains, which is not made weak until we65 // call world->destroy().66 //67 // FIXME: We want to eventually be holding window shells instead of the68 // IsolatedContext directly.69 // https://bugs.webkit.org/show_bug.cgi?id=9487570 typedef HashMap<int, V8IsolatedContext*> IsolatedWorldMap;71 72 typedef HashMap<int, RefPtr<SecurityOrigin> > IsolatedWorldSecurityOriginMap;73 61 74 62 typedef WTF::Vector<v8::Extension*> V8Extensions; … … 79 67 ~ScriptController(); 80 68 81 // FIXME: This should eventually take DOMWrapperWorld argument.82 // https://bugs.webkit.org/show_bug.cgi?id=9487583 69 V8DOMWindowShell* windowShell() const { return m_windowShell.get(); } 70 V8DOMWindowShell* windowShell(DOMWrapperWorld*); 71 // FIXME: Replace existingWindowShell with existingWindowShellInternal see comment in V8DOMWindowShell::initializeIfNeeded. 72 ScriptController* existingWindowShell(DOMWrapperWorld*) { return this; } 73 V8DOMWindowShell* existingWindowShellInternal(DOMWrapperWorld*); 84 74 85 75 ScriptValue executeScript(const ScriptSourceCode&); … … 105 95 // The caller must hold an execution context. 106 96 ScriptValue evaluate(const ScriptSourceCode&); 107 108 // Evaluate JavaScript in a new isolated world. The script gets its own109 // global scope, its own prototypes for intrinsic JavaScript objects (String,110 // Array, and so-on), and its own wrappers for all DOM nodes and DOM111 // constructors.112 void evaluateInIsolatedWorld(unsigned worldID, const Vector<ScriptSourceCode>& sources, Vector<ScriptValue>* results);113 97 114 98 // Executes JavaScript in an isolated world. The script gets its own global scope, … … 119 103 // Otherwise, a new world is created. 120 104 // 121 // If the worldID is 0 , a new world is always created.105 // If the worldID is 0 or DOMWrapperWorld::uninitializedWorldId, a new world is always created. 122 106 // 123 107 // FIXME: Get rid of extensionGroup here. 124 void evaluateInIsolatedWorld( unsignedworldID, const Vector<ScriptSourceCode>& sources, int extensionGroup, Vector<ScriptValue>* results);108 void evaluateInIsolatedWorld(int worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup, Vector<ScriptValue>* results); 125 109 126 110 // Associates an isolated world (see above for description) with a security … … 128 112 // to come from that origin, not the frame's. 129 113 void setIsolatedWorldSecurityOrigin(int worldID, PassRefPtr<SecurityOrigin>); 130 131 // Masquerade 'this' as the windowShell.132 // This is a bit of a hack, but provides reasonable compatibility133 // with what JSC does as well.134 ScriptController* windowShell(DOMWrapperWorld*) { return this; }135 ScriptController* existingWindowShell(DOMWrapperWorld*) { return this; }136 114 137 115 // Creates a property of the global object of a frame. … … 209 187 210 188 private: 189 // Note: although the pointer is raw, the instance is kept alive by a strong 190 // reference to the v8 context it contains, which is not made weak until we 191 // call world->destroyIsolatedShell(). 192 typedef HashMap<int, V8DOMWindowShell*> IsolatedWorldMap; 193 typedef HashMap<int, RefPtr<SecurityOrigin> > IsolatedWorldSecurityOriginMap; 194 211 195 void resetIsolatedWorlds(); 212 196 … … 214 198 const String* m_sourceURL; 215 199 216 // For the moment, we have one of these. Soon we will have one per DOMWrapperWorld.200 V8DOMWindowShell* ensureIsolatedWorldContext(int worldId, int extensionGroup); 217 201 OwnPtr<V8DOMWindowShell> m_windowShell; 218 202 … … 221 205 // evaluateInIsolatedWorld(). 222 206 IsolatedWorldMap m_isolatedWorlds; 223 224 207 IsolatedWorldSecurityOriginMap m_isolatedWorldSecurityOrigins; 225 208 -
trunk/Source/WebCore/bindings/v8/SharedPersistent.h
r95901 r128159 32 32 #define SharedPersistent_h 33 33 34 #include "ScopedPersistent.h" 34 35 #include <v8.h> 35 36 #include <wtf/PassRefPtr.h> … … 38 39 namespace WebCore { 39 40 40 // A shareable reference to a v8 persistent handle. Using a shared 41 // persistent any number of objects can share a reference to a v8 42 // object and when it should no longer be accessible the object's 43 // owner can clear it. 41 // FIXME: Remove this class. 44 42 template <typename T> 45 43 class SharedPersistent : public RefCounted<SharedPersistent<T> > { 46 44 public: 47 void set(v8::Persistent<T> value) 48 { 49 m_value = value; 50 } 51 v8::Persistent<T> get() 52 { 53 return m_value; 54 } 55 void disposeHandle() 56 { 57 if (!m_value.IsEmpty()) { 58 m_value.Dispose(); 59 m_value.Clear(); 60 } 61 } 62 static PassRefPtr<SharedPersistent<T> > create(v8::Persistent<T> value) 45 static PassRefPtr<SharedPersistent<T> > create(v8::Handle<T> value) 63 46 { 64 47 return adoptRef(new SharedPersistent<T>(value)); 65 48 } 66 static PassRefPtr<SharedPersistent<T> > create()49 inline v8::Persistent<T> get() 67 50 { 68 return create(v8::Persistent<T>());51 return m_value.get(); 69 52 } 70 53 private: 71 explicit SharedPersistent(v8:: Persistent<T> value) : m_value(value) { }72 v8::Persistent<T> m_value;54 explicit SharedPersistent(v8::Handle<T> value) : m_value(value) { } 55 ScopedPersistent<T> m_value; 73 56 }; 74 57 -
trunk/Source/WebCore/bindings/v8/V8Binding.cpp
r127972 r128159 311 311 V8PerContextData* perContextDataForCurrentWorld(Frame* frame) 312 312 { 313 V8 IsolatedContext* isolatedContext;314 if (UNLIKELY(!!(isolated Context = V8IsolatedContext::getEntered())))315 return isolated Context->perContextData();313 V8DOMWindowShell* isolatedShell; 314 if (UNLIKELY(!!(isolatedShell = V8DOMWindowShell::getEntered()))) 315 return isolatedShell->perContextData(); 316 316 return frame->script()->windowShell()->perContextData(); 317 317 } -
trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
r127977 r128159 38 38 #include "Frame.h" 39 39 #include "FrameLoaderClient.h" 40 #include "InspectorInstrumentation.h" 40 41 #include "MemoryUsageSupport.h" 41 42 #include "Page.h" … … 171 172 } 172 173 173 PassOwnPtr<V8DOMWindowShell> V8DOMWindowShell::create(Frame* frame) 174 { 175 return adoptPtr(new V8DOMWindowShell(frame)); 176 } 177 178 V8DOMWindowShell::V8DOMWindowShell(Frame* frame) 174 static void setIsolatedWorldField(V8DOMWindowShell* shell, v8::Local<v8::Context> context) 175 { 176 toInnerGlobalObject(context)->SetPointerInInternalField(V8DOMWindow::enteredIsolatedWorldIndex, shell); 177 } 178 179 V8DOMWindowShell* V8DOMWindowShell::enteredIsolatedWorldContext() 180 { 181 return static_cast<V8DOMWindowShell*>(toInnerGlobalObject(v8::Context::GetEntered())->GetPointerFromInternalField(V8DOMWindow::enteredIsolatedWorldIndex)); 182 } 183 184 static void setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetContext, int debugId) 185 { 186 char buffer[32]; 187 if (debugId == -1) 188 snprintf(buffer, sizeof(buffer), "injected"); 189 else 190 snprintf(buffer, sizeof(buffer), "injected,%d", debugId); 191 targetContext->SetData(v8::String::New(buffer)); 192 } 193 194 PassOwnPtr<V8DOMWindowShell> V8DOMWindowShell::create(Frame* frame, PassRefPtr<DOMWrapperWorld> world) 195 { 196 return adoptPtr(new V8DOMWindowShell(frame, world)); 197 } 198 199 V8DOMWindowShell::V8DOMWindowShell(Frame* frame, PassRefPtr<DOMWrapperWorld> world) 179 200 : m_frame(frame) 201 , m_world(world) 180 202 { 181 203 } … … 187 209 } 188 210 189 void V8DOMWindowShell::disposeContext() 190 { 211 void V8DOMWindowShell::destroyIsolatedShell() 212 { 213 disposeContext(true); 214 } 215 216 static void isolatedContextWeakCallback(v8::Persistent<v8::Value> object, void* parameter) 217 { 218 // Handle will be disposed in delete. 219 delete static_cast<V8DOMWindowShell*>(parameter); 220 } 221 222 void V8DOMWindowShell::disposeContext(bool weak) 223 { 224 ASSERT(!m_context.get().IsWeak()); 191 225 m_perContextData.clear(); 192 226 193 if (!m_context.isEmpty()) { 194 m_frame->loader()->client()->willReleaseScriptContext(m_context.get(), 0); 227 if (m_context.isEmpty()) 228 return; 229 230 m_frame->loader()->client()->willReleaseScriptContext(m_context.get(), m_world->worldId()); 231 232 if (!weak) 195 233 m_context.clear(); 196 197 // It's likely that disposing the context has created a lot of 198 // garbage. Notify V8 about this so it'll have a chance of cleaning 199 // it up when idle. 200 bool isMainFrame = m_frame->page() && (m_frame->page()->mainFrame() == m_frame); 234 else { 235 ASSERT(!m_world->isMainWorld()); 236 destroyGlobal(); 237 m_frame = 0; 238 m_context.get().MakeWeak(this, isolatedContextWeakCallback); 239 } 240 241 // It's likely that disposing the context has created a lot of 242 // garbage. Notify V8 about this so it'll have a chance of cleaning 243 // it up when idle. 244 if (m_world->isMainWorld()) { 245 bool isMainFrame = m_frame->page() && (m_frame->page()->mainFrame() == m_frame); 201 246 V8GCForContextDispose::instance().notifyContextDisposed(isMainFrame); 202 247 } … … 285 330 initializeV8IfNeeded(); 286 331 287 m_context.adopt(createNewContext(m_global.get(), 0, 0));332 createContext(); 288 333 if (m_context.isEmpty()) 289 334 return false; 335 336 bool isMainWorld = m_world->isMainWorld(); 290 337 291 338 v8::Local<v8::Context> context = v8::Local<v8::Context>::New(m_context.get()); … … 300 347 } 301 348 349 // Flag context as isolated. 350 if (!isMainWorld) { 351 V8DOMWindowShell* mainWindow = m_frame->script()->windowShell(); 352 mainWindow->initializeIfNeeded(); 353 if (!mainWindow->context().IsEmpty()) 354 setInjectedScriptContextDebugId(m_context.get(), m_frame->script()->contextDebugId(mainWindow->context())); 355 setIsolatedWorldField(this, context); 356 } 357 302 358 m_perContextData = V8PerContextData::create(m_context.get()); 303 359 if (!m_perContextData->init()) { … … 306 362 } 307 363 308 if (!installDOMWindow( context, m_frame->document()->domWindow())) {364 if (!installDOMWindow()) { 309 365 disposeContext(); 310 366 return false; 311 367 } 312 368 313 updateDocument(); 314 315 setSecurityToken(); 316 317 if (m_frame->document()) 318 context->AllowCodeGenerationFromStrings(m_frame->document()->contentSecurityPolicy()->allowEval(0, ContentSecurityPolicy::SuppressReport)); 319 320 m_frame->loader()->client()->didCreateScriptContext(m_context.get(), 0, 0); 321 322 // FIXME: This is wrong. We should actually do this for the proper world once 323 // we do isolated worlds the WebCore way. 324 m_frame->loader()->dispatchDidClearWindowObjectInWorld(0); 369 if (isMainWorld) { 370 updateDocument(); 371 setSecurityToken(); 372 if (m_frame->document()) 373 context->AllowCodeGenerationFromStrings(m_frame->document()->contentSecurityPolicy()->allowEval(0, ContentSecurityPolicy::SuppressReport)); 374 } else { 375 // Using the default security token means that the canAccess is always 376 // called, which is slow. 377 // FIXME: Use tokens where possible. This will mean keeping track of all 378 // created contexts so that they can all be updated when the 379 // document domain 380 // changes. 381 m_context->UseDefaultSecurityToken(); 382 } 383 m_frame->loader()->client()->didCreateScriptContext(m_context.get(), m_world->extensionGroup(), m_world->worldId()); 384 385 if (isMainWorld) { 386 // FIXME: This call is probably in the wrong spot, but causes a test timeout for http/tests/misc/window-open-then-write.html when removed. 387 // Additionally, ScriptController::existingWindowShell cannot be correctly implemented until this call is gone. 388 m_frame->loader()->dispatchDidClearWindowObjectInWorld(0); 389 } 325 390 326 391 return true; 327 392 } 328 393 329 v8::Persistent<v8::Context> V8DOMWindowShell::createNewContext(v8::Handle<v8::Object> global, int extensionGroup, int worldId) 330 { 331 v8::Persistent<v8::Context> result; 332 394 void V8DOMWindowShell::createContext() 395 { 333 396 // The activeDocumentLoader pointer could be 0 during frame shutdown. 334 397 // FIXME: Can we remove this check? 335 398 if (!m_frame->loader()->activeDocumentLoader()) 336 return result;399 return; 337 400 338 401 // Create a new environment using an empty template for the shadow … … 340 403 v8::Persistent<v8::ObjectTemplate> globalTemplate = V8DOMWindow::GetShadowObjectTemplate(); 341 404 if (globalTemplate.IsEmpty()) 342 return result;405 return; 343 406 344 407 // Used to avoid sleep calls in unload handlers. … … 355 418 OwnArrayPtr<const char*> extensionNames = adoptArrayPtr(new const char*[extensions.size()]); 356 419 int index = 0; 420 int extensionGroup = m_world->extensionGroup(); 421 int worldId = m_world->worldId(); 357 422 for (size_t i = 0; i < extensions.size(); ++i) { 358 423 // Ensure our date extension is always allowed. … … 364 429 } 365 430 v8::ExtensionConfiguration extensionConfiguration(index, extensionNames.get()); 366 result = v8::Context::New(&extensionConfiguration, globalTemplate, global); 367 368 return result; 369 } 370 371 bool V8DOMWindowShell::installDOMWindow(v8::Handle<v8::Context> context, DOMWindow* window) 372 { 431 432 m_context.adopt(v8::Context::New(&extensionConfiguration, globalTemplate, m_global.get())); 433 } 434 435 bool V8DOMWindowShell::installDOMWindow() 436 { 437 DOMWindow* window = m_frame->document()->domWindow(); 373 438 v8::Local<v8::Object> windowWrapper = V8ObjectConstructor::newInstance(V8DOMWrapper::constructorForType(&V8DOMWindow::info, window)); 374 439 if (windowWrapper.IsEmpty()) … … 394 459 // JavaScript object. 395 460 // 396 v8::Handle<v8::Object> innerGlobalObject = toInnerGlobalObject( context);461 v8::Handle<v8::Object> innerGlobalObject = toInnerGlobalObject(m_context.get()); 397 462 V8DOMWrapper::setDOMWrapper(innerGlobalObject, &V8DOMWindow::info, window); 398 463 innerGlobalObject->SetPrototype(windowWrapper); … … 402 467 void V8DOMWindowShell::updateDocumentWrapper(v8::Handle<v8::Object> wrapper) 403 468 { 469 ASSERT(m_world->isMainWorld()); 404 470 m_document.set(wrapper); 405 471 } … … 407 473 void V8DOMWindowShell::updateDocumentProperty() 408 474 { 475 if (!m_world->isMainWorld()) 476 return; 477 409 478 v8::HandleScope handleScope; 410 479 // FIXME: Should we use a new Local handle here? … … 435 504 { 436 505 ASSERT(!m_context.isEmpty()); 506 if (!m_world->isMainWorld()) 507 return; 437 508 m_context->Global()->ForceDelete(v8::String::New("document")); 438 509 } … … 440 511 void V8DOMWindowShell::setSecurityToken() 441 512 { 513 ASSERT(m_world->isMainWorld()); 514 442 515 Document* document = m_frame->document(); 443 516 … … 470 543 void V8DOMWindowShell::updateDocument() 471 544 { 545 ASSERT(m_world->isMainWorld()); 472 546 if (m_global.isEmpty()) 473 547 return; … … 495 569 void V8DOMWindowShell::namedItemAdded(HTMLDocument* document, const AtomicString& name) 496 570 { 571 ASSERT(m_world->isMainWorld()); 572 497 573 if (!initializeIfNeeded()) 498 574 return; … … 508 584 void V8DOMWindowShell::namedItemRemoved(HTMLDocument* document, const AtomicString& name) 509 585 { 586 ASSERT(m_world->isMainWorld()); 587 510 588 if (document->hasNamedItem(name.impl()) || document->hasExtraNamedItem(name.impl())) 511 589 return; … … 524 602 void V8DOMWindowShell::updateSecurityOrigin() 525 603 { 604 ASSERT(m_world->isMainWorld()); 526 605 if (m_context.isEmpty()) 527 606 return; … … 530 609 } 531 610 611 void V8DOMWindowShell::setIsolatedWorldSecurityOrigin(PassRefPtr<SecurityOrigin> securityOrigin) 612 { 613 ASSERT(!m_world->isMainWorld()); 614 // FIXME: Should this be here? 615 if (!m_isolatedWorldShellSecurityOrigin && !context().IsEmpty() && InspectorInstrumentation::hasFrontends()) { 616 v8::HandleScope handleScope; 617 ScriptState* scriptState = ScriptState::forContext(v8::Local<v8::Context>::New(context())); 618 InspectorInstrumentation::didCreateIsolatedContext(m_frame, scriptState, securityOrigin.get()); 619 } 620 m_isolatedWorldShellSecurityOrigin = securityOrigin; 621 } 622 532 623 } // WebCore -
trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.h
r127977 r128159 32 32 #define V8DOMWindowShell_h 33 33 34 #include "DOMWrapperWorld.h" 34 35 #include "ScopedPersistent.h" 36 #include "SecurityOrigin.h" 35 37 #include "V8PerContextData.h" 36 38 #include "WrapperTypeInfo.h" … … 52 54 class V8DOMWindowShell { 53 55 public: 54 static PassOwnPtr<V8DOMWindowShell> create(Frame* );56 static PassOwnPtr<V8DOMWindowShell> create(Frame*, PassRefPtr<DOMWrapperWorld>); 55 57 56 58 v8::Persistent<v8::Context> context() const { return m_context.get(); } … … 69 71 70 72 v8::Persistent<v8::Context> createNewContext(v8::Handle<v8::Object> global, int extensionGroup, int worldId); 71 static bool installDOMWindow(v8::Handle<v8::Context> context, DOMWindow*);72 73 73 74 bool initializeIfNeeded(); … … 81 82 V8PerContextData* perContextData() { return m_perContextData.get(); } 82 83 84 DOMWrapperWorld* world() { return m_world.get(); } 85 86 void setIsolatedWorldSecurityOrigin(PassRefPtr<SecurityOrigin>); 87 SecurityOrigin* isolatedWorldSecurityOrigin() const 88 { 89 ASSERT(!m_world->isMainWorld()); 90 return m_isolatedWorldShellSecurityOrigin.get(); 91 }; 92 93 // Returns the isolated world associated with 94 // v8::Context::GetEntered(). Because worlds are isolated, the entire 95 // JavaScript call stack should be from the same isolated world. 96 // Returns 0 if the entered context is from the main world. 97 // 98 // FIXME: Consider edge cases with DOM mutation events that might 99 // violate this invariant. 100 // 101 // FIXME: This is poorly named after the deletion of isolated contexts. 102 static V8DOMWindowShell* getEntered() 103 { 104 if (!DOMWrapperWorld::isolatedWorldsExist()) 105 return 0; 106 if (!v8::Context::InContext()) 107 return 0; 108 return enteredIsolatedWorldContext(); 109 } 110 111 void destroyIsolatedShell(); 83 112 private: 84 explicit V8DOMWindowShell(Frame*);113 V8DOMWindowShell(Frame*, PassRefPtr<DOMWrapperWorld>); 85 114 86 void disposeContext( );115 void disposeContext(bool weak = false); 87 116 88 117 void setSecurityToken(); … … 95 124 void clearDocumentProperty(); 96 125 126 void createContext(); 127 bool installDOMWindow(); 128 129 static V8DOMWindowShell* enteredIsolatedWorldContext(); 130 97 131 Frame* m_frame; 132 RefPtr<DOMWrapperWorld> m_world; 98 133 99 134 OwnPtr<V8PerContextData> m_perContextData; … … 102 137 ScopedPersistent<v8::Object> m_global; 103 138 ScopedPersistent<v8::Object> m_document; 139 140 // FIXME: Either remove this or the map in ScriptController. 141 RefPtr<SecurityOrigin> m_isolatedWorldShellSecurityOrigin; 104 142 }; 105 143 -
trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h
r128102 r128159 38 38 #include "V8CustomXPathNSResolver.h" 39 39 #include "V8DOMMap.h" 40 #include "V8 IsolatedContext.h"40 #include "V8DOMWindowShell.h" 41 41 #include "V8Utilities.h" 42 42 #include "WrapperTypeInfo.h" … … 124 124 } 125 125 126 V8 IsolatedContext* context = V8IsolatedContext::getEntered();126 V8DOMWindowShell* context = V8DOMWindowShell::getEntered(); 127 127 if (LIKELY(!context)) { 128 128 v8::Persistent<v8::Object>* wrapper = node->wrapper(); -
trunk/Source/WebCore/bindings/v8/V8LazyEventListener.cpp
r128126 r128159 38 38 #include "HTMLFormElement.h" 39 39 #include "Node.h" 40 #include "ScriptSourceCode.h" 40 41 #include "V8Binding.h" 41 42 #include "V8DOMWrapper.h" -
trunk/Source/WebCore/bindings/v8/WorldContextHandle.cpp
r126083 r128159 33 33 34 34 #include "ScriptController.h" 35 #include "V8 IsolatedContext.h"35 #include "V8DOMWindowShell.h" 36 36 37 37 namespace WebCore { … … 43 43 return; 44 44 45 if (V8IsolatedContext* context = V8IsolatedContext::getEntered()) 46 m_context = context->sharedContext(); 45 V8DOMWindowShell* shell = V8DOMWindowShell::getEntered(); 46 if (LIKELY(!shell)) { 47 m_worldToUse = UseMainWorld; 48 return; 49 } 50 51 ASSERT(!shell->context().IsEmpty()); 52 m_context = SharedPersistent<v8::Context>::create(shell->context()); 47 53 } 48 54 49 55 v8::Local<v8::Context> WorldContextHandle::adjustedContext(ScriptController* script) const 50 56 { 51 if (m_worldToUse == UseMainWorld || !m_context || m_context->get().IsEmpty())57 if (m_worldToUse == UseMainWorld) 52 58 return script->mainWorldContext(); 53 59 60 ASSERT(!m_context->get().IsEmpty()); 54 61 return v8::Local<v8::Context>::New(m_context->get()); 55 62 } -
trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
r127946 r128159 45 45 #include "V8CustomXPathNSResolver.h" 46 46 #include "V8DOMImplementation.h" 47 #include "V8DOMWindowShell.h" 47 48 #include "V8DOMWrapper.h" 48 49 #include "V8HTMLDocument.h" 49 #include "V8IsolatedContext.h"50 50 #include "V8Node.h" 51 51 #include "V8Touch.h" … … 131 131 if (wrapper.IsEmpty()) 132 132 return wrapper; 133 if (!V8 IsolatedContext::getEntered()) {133 if (!V8DOMWindowShell::getEntered()) { 134 134 if (Frame* frame = impl->frame()) 135 135 frame->script()->windowShell()->updateDocumentWrapper(wrapper); -
trunk/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
r128095 r128159 41 41 #include "V8Binding.h" 42 42 #include "V8DOMWindow.h" 43 #include "V8DOMWindowShell.h" 43 44 #include "V8HTMLAllCollection.h" 44 45 #include "V8HTMLCollection.h" 45 #include "V8IsolatedContext.h"46 46 #include "V8Node.h" 47 47 #include "V8RecursionScope.h" … … 184 184 if (wrapper.IsEmpty()) 185 185 return wrapper; 186 if (!V8 IsolatedContext::getEntered()) {186 if (!V8DOMWindowShell::getEntered()) { 187 187 if (Frame* frame = impl->frame()) 188 188 frame->script()->windowShell()->updateDocumentWrapper(wrapper); -
trunk/Source/WebCore/bindings/v8/custom/V8SVGDocumentCustom.cpp
r127946 r128159 35 35 36 36 #include "Frame.h" 37 #include "V8 IsolatedContext.h"37 #include "V8DOMWindowShell.h" 38 38 39 39 namespace WebCore { … … 46 46 if (wrapper.IsEmpty()) 47 47 return wrapper; 48 if (!V8 IsolatedContext::getEntered()) {48 if (!V8DOMWindowShell::getEntered()) { 49 49 if (Frame* frame = impl->frame()) 50 50 frame->script()->windowShell()->updateDocumentWrapper(wrapper); -
trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp
r128139 r128159 36 36 #include "SecurityOrigin.h" 37 37 #include "V8Binding.h" 38 #include "V8 IsolatedContext.h"38 #include "V8DOMWindowShell.h" 39 39 #include "V8Utilities.h" 40 40 #include "WorkerContext.h" … … 56 56 57 57 RefPtr<SecurityOrigin> securityOrigin; 58 if (V8 IsolatedContext* isolatedContext = V8IsolatedContext::getEntered())59 securityOrigin = isolated Context->securityOrigin();58 if (V8DOMWindowShell* isolatedWorldShell = V8DOMWindowShell::getEntered()) 59 securityOrigin = isolatedWorldShell->isolatedWorldSecurityOrigin(); 60 60 61 61 RefPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context, securityOrigin);
Note: See TracChangeset
for help on using the changeset viewer.