Changeset 139610 in webkit
- Timestamp:
- Jan 14, 2013 5:08:17 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r139607 r139610 1 2013-01-14 Kentaro Hara <haraken@chromium.org> 2 3 [V8] Add m_isolate to ScriptController, WorkerScriptController and V8DOMWindowShell 4 https://bugs.webkit.org/show_bug.cgi?id=106771 5 6 Reviewed by Adam Barth. 7 8 This is one of the steps to pass an Isolate everywhere. 9 10 No tests. No change in behavior. 11 12 * bindings/v8/ScriptController.cpp: 13 (WebCore::ScriptController::ScriptController): 14 (WebCore::ScriptController::windowShell): 15 * bindings/v8/ScriptController.h: 16 (ScriptController): 17 * bindings/v8/V8DOMWindowShell.cpp: 18 (WebCore::V8DOMWindowShell::create): 19 (WebCore::V8DOMWindowShell::V8DOMWindowShell): 20 (WebCore::V8DOMWindowShell::initializeIfNeeded): 21 (WebCore::V8DOMWindowShell::installDOMWindow): 22 * bindings/v8/V8DOMWindowShell.h: 23 (V8DOMWindowShell): 24 * bindings/v8/V8Initializer.cpp: 25 (WebCore::V8Initializer::initializeMainThreadIfNeeded): 26 (WebCore::V8Initializer::initializeWorker): 27 * bindings/v8/V8Initializer.h: 28 (V8Initializer): 29 * bindings/v8/WorkerScriptController.cpp: 30 (WebCore::WorkerScriptController::WorkerScriptController): 31 (WebCore::WorkerScriptController::initializeContextIfNeeded): 32 1 33 2013-01-14 Alexander Pavlov <apavlov@chromium.org> 2 34 -
trunk/Source/WebCore/bindings/v8/ScriptController.cpp
r136822 r139610 103 103 : m_frame(frame) 104 104 , m_sourceURL(0) 105 , m_windowShell(V8DOMWindowShell::create(frame, mainThreadNormalWorld())) 105 , m_isolate(v8::Isolate::GetCurrent()) 106 , m_windowShell(V8DOMWindowShell::create(frame, mainThreadNormalWorld(), m_isolate)) 106 107 , m_paused(false) 107 108 #if ENABLE(NETSCAPE_PLUGIN_API) … … 358 359 shell = iter->value.get(); 359 360 else { 360 OwnPtr<V8DOMWindowShell> isolatedWorldShell = V8DOMWindowShell::create(m_frame, world );361 OwnPtr<V8DOMWindowShell> isolatedWorldShell = V8DOMWindowShell::create(m_frame, world, m_isolate); 361 362 shell = isolatedWorldShell.get(); 362 363 m_isolatedWorlds.set(world->worldId(), isolatedWorldShell.release()); -
trunk/Source/WebCore/bindings/v8/ScriptController.h
r135687 r139610 200 200 Frame* m_frame; 201 201 const String* m_sourceURL; 202 v8::Isolate* m_isolate; 202 203 203 204 OwnPtr<V8DOMWindowShell> m_windowShell; -
trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
r136822 r139610 82 82 } 83 83 84 PassOwnPtr<V8DOMWindowShell> V8DOMWindowShell::create(Frame* frame, PassRefPtr<DOMWrapperWorld> world )85 { 86 return adoptPtr(new V8DOMWindowShell(frame, world ));87 } 88 89 V8DOMWindowShell::V8DOMWindowShell(Frame* frame, PassRefPtr<DOMWrapperWorld> world )84 PassOwnPtr<V8DOMWindowShell> V8DOMWindowShell::create(Frame* frame, PassRefPtr<DOMWrapperWorld> world, v8::Isolate* isolate) 85 { 86 return adoptPtr(new V8DOMWindowShell(frame, world, isolate)); 87 } 88 89 V8DOMWindowShell::V8DOMWindowShell(Frame* frame, PassRefPtr<DOMWrapperWorld> world, v8::Isolate* isolate) 90 90 : m_frame(frame) 91 91 , m_world(world) 92 , m_isolate(isolate) 92 93 { 93 94 } … … 202 203 v8::HandleScope handleScope; 203 204 204 V8Initializer::initializeMainThreadIfNeeded( );205 V8Initializer::initializeMainThreadIfNeeded(m_isolate); 205 206 206 207 createContext(); … … 335 336 V8DOMWrapper::setNativeInfo(innerGlobalObject, &V8DOMWindow::info, window); 336 337 innerGlobalObject->SetPrototype(windowWrapper); 337 V8DOMWrapper::associateObjectWithWrapper(PassRefPtr<DOMWindow>(window), &V8DOMWindow::info, windowWrapper );338 V8DOMWrapper::associateObjectWithWrapper(PassRefPtr<DOMWindow>(window), &V8DOMWindow::info, windowWrapper, m_isolate); 338 339 return true; 339 340 } -
trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.h
r135687 r139610 54 54 class V8DOMWindowShell { 55 55 public: 56 static PassOwnPtr<V8DOMWindowShell> create(Frame*, PassRefPtr<DOMWrapperWorld> );56 static PassOwnPtr<V8DOMWindowShell> create(Frame*, PassRefPtr<DOMWrapperWorld>, v8::Isolate*); 57 57 58 58 v8::Persistent<v8::Context> context() const { return m_context.get(); } … … 82 82 83 83 private: 84 V8DOMWindowShell(Frame*, PassRefPtr<DOMWrapperWorld> );84 V8DOMWindowShell(Frame*, PassRefPtr<DOMWrapperWorld>, v8::Isolate*); 85 85 86 86 void disposeContext(); … … 102 102 Frame* m_frame; 103 103 RefPtr<DOMWrapperWorld> m_world; 104 v8::Isolate* m_isolate; 104 105 105 106 OwnPtr<V8PerContextData> m_perContextData; -
trunk/Source/WebCore/bindings/v8/V8Initializer.cpp
r136605 r139610 41 41 #include "V8Location.h" 42 42 #include "V8PerContextData.h" 43 #include <v8.h>44 43 #include <wtf/RefPtr.h> 45 44 #include <wtf/text/WTFString.h> … … 105 104 } 106 105 107 void V8Initializer::initializeMainThreadIfNeeded( )106 void V8Initializer::initializeMainThreadIfNeeded(v8::Isolate* isolate) 108 107 { 109 108 ASSERT(isMainThread()); … … 123 122 ScriptProfiler::initialize(); 124 123 #endif 125 V8PerIsolateData::ensureInitialized( v8::Isolate::GetCurrent());124 V8PerIsolateData::ensureInitialized(isolate); 126 125 127 126 // FIXME: Remove the following 2 lines when V8 default has changed. … … 158 157 static const int kWorkerMaxStackSize = 500 * 1024; 159 158 160 void V8Initializer::initializeWorker( )159 void V8Initializer::initializeWorker(v8::Isolate* isolate) 161 160 { 162 161 v8::V8::AddMessageListener(messageHandlerInWorker); … … 176 175 v8::SetResourceConstraints(&resourceConstraints); 177 176 178 V8PerIsolateData::ensureInitialized( v8::Isolate::GetCurrent());177 V8PerIsolateData::ensureInitialized(isolate); 179 178 } 180 179 -
trunk/Source/WebCore/bindings/v8/V8Initializer.h
r135674 r139610 27 27 #define V8Initializer_h 28 28 29 #include <v8.h> 30 29 31 namespace WebCore { 30 32 31 33 class V8Initializer { 32 34 public: 33 static void initializeMainThreadIfNeeded( );34 static void initializeWorker( );35 static void initializeMainThreadIfNeeded(v8::Isolate*); 36 static void initializeWorker(v8::Isolate*); 35 37 }; 36 38 -
trunk/Source/WebCore/bindings/v8/WorkerScriptController.cpp
r136822 r139610 67 67 data->setDOMDataStore(m_domDataStore.get()); 68 68 69 V8Initializer::initializeWorker( );69 V8Initializer::initializeWorker(m_isolate); 70 70 } 71 71 … … 128 128 } 129 129 130 V8DOMWrapper::associateObjectWithWrapper(PassRefPtr<WorkerContext>(m_workerContext), contextType, jsWorkerContext );130 V8DOMWrapper::associateObjectWithWrapper(PassRefPtr<WorkerContext>(m_workerContext), contextType, jsWorkerContext, m_isolate); 131 131 132 132 // Insert the object instance as the prototype of the shadow object.
Note: See TracChangeset
for help on using the changeset viewer.