Changeset 61466 in webkit
- Timestamp:
- Jun 18, 2010 11:54:24 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r61463 r61466 1 2010-06-18 Aaron Boodman <aa@chromium.org> 2 3 WebKit API: Undo static hooks into V8 when WebKit is shut down. 4 https://bugs.webkit.org/show_bug.cgi?id=40816 5 6 * bindings/v8/V8DOMWindowShell.cpp: 7 (WebCore::V8DOMWindowShell::initContextIfNeeded): 8 (WebCore::V8DOMWindowShell::initializeV8IfNeeded): 9 (WebCore::V8DOMWindowShell::uninitializeV8IfNeeded): 10 * bindings/v8/V8DOMWindowShell.h: 11 1 12 2010-06-18 Jessie Berlin <jberlin@webkit.org> 2 13 -
trunk/WebCore/bindings/v8/V8DOMWindowShell.cpp
r60670 r61466 117 117 V8Proxy::reportUnsafeAccessTo(target, V8Proxy::ReportLater); 118 118 } 119 120 bool V8DOMWindowShell::s_isV8Initialized = false; 119 121 120 122 PassRefPtr<V8DOMWindowShell> V8DOMWindowShell::create(Frame* frame) … … 248 250 v8::HandleScope handleScope; 249 251 250 // Setup the security handlers and message listener. This only has 251 // to be done once. 252 static bool isV8Initialized = false; 253 if (!isV8Initialized) { 254 // Tells V8 not to call the default OOM handler, binding code 255 // will handle it. 256 v8::V8::IgnoreOutOfMemoryException(); 257 v8::V8::SetFatalErrorHandler(reportFatalErrorInV8); 258 259 v8::V8::SetGlobalGCPrologueCallback(&V8GCController::gcPrologue); 260 v8::V8::SetGlobalGCEpilogueCallback(&V8GCController::gcEpilogue); 261 262 v8::V8::AddMessageListener(&V8ConsoleMessage::handler); 263 264 v8::V8::SetFailedAccessCheckCallbackFunction(reportUnsafeJavaScriptAccess); 265 266 isV8Initialized = true; 267 } 268 252 initializeV8IfNeeded(); 269 253 270 254 m_context = createNewContext(m_global, 0); … … 309 293 } 310 294 295 void V8DOMWindowShell::initializeV8IfNeeded() 296 { 297 if (s_isV8Initialized) 298 return; 299 300 // Tells V8 not to call the default OOM handler, binding code 301 // will handle it. 302 v8::V8::IgnoreOutOfMemoryException(); 303 v8::V8::SetFatalErrorHandler(reportFatalErrorInV8); 304 305 v8::V8::SetGlobalGCPrologueCallback(&V8GCController::gcPrologue); 306 v8::V8::SetGlobalGCEpilogueCallback(&V8GCController::gcEpilogue); 307 308 v8::V8::AddMessageListener(&V8ConsoleMessage::handler); 309 310 v8::V8::SetFailedAccessCheckCallbackFunction(reportUnsafeJavaScriptAccess); 311 312 s_isV8Initialized = true; 313 } 314 315 void V8DOMWindowShell::uninitializeV8IfNeeded() 316 { 317 if (!s_isV8Initialized) 318 return; 319 320 v8::V8::SetFatalErrorHandler(0); 321 v8::V8::SetGlobalGCPrologueCallback(0); 322 v8::V8::SetGlobalGCEpilogueCallback(0); 323 v8::V8::SetFailedAccessCheckCallbackFunction(0); 324 v8::V8::RemoveMessageListeners(&V8ConsoleMessage::handler); 325 326 // FIXME: This one cannot be undone yet. 327 // v8::V8::IgnoreOutOfMemoryException(); 328 329 s_isV8Initialized = false; 330 } 331 311 332 v8::Persistent<v8::Context> V8DOMWindowShell::createNewContext(v8::Handle<v8::Object> global, int extensionGroup) 312 333 { -
trunk/WebCore/bindings/v8/V8DOMWindowShell.h
r60670 r61466 51 51 public: 52 52 static PassRefPtr<V8DOMWindowShell> create(Frame*); 53 static void initializeV8IfNeeded(); 54 static void uninitializeV8IfNeeded(); 53 55 54 56 v8::Handle<v8::Context> context() const { return m_context; } … … 120 122 v8::Persistent<v8::Object> m_global; 121 123 v8::Persistent<v8::Object> m_document; 124 125 static bool s_isV8Initialized; 122 126 }; 123 127 -
trunk/WebKit/chromium/ChangeLog
r61458 r61466 1 2010-06-18 Aaron Boodman <aa@chromium.org> 2 3 WebKit API: Undo static hooks into V8 when WebKit is shut downm 4 https://bugs.webkit.org/show_bug.cgi?id=40816 5 6 * src/WebKit.cpp: 7 (WebKit::shutdown): Call new WebCore::V8DOMWindowShell::uninitializeV8IfNeeded(). 8 1 9 2010-06-18 Drew Wilson <atwilson@chromium.org> 2 10 -
trunk/WebKit/chromium/src/WebKit.cpp
r58266 r61466 42 42 #include "WorkerContextExecutionProxy.h" 43 43 44 #if USE(V8) 45 #include "V8DOMWindowShell.h" 46 #endif 47 44 48 #include <wtf/Assertions.h> 45 49 #include <wtf/Threading.h> … … 79 83 void shutdown() 80 84 { 85 #if USE(V8) 86 WebCore::V8DOMWindowShell::uninitializeV8IfNeeded(); 87 #endif 81 88 s_webKitClient = 0; 82 89 }
Note: See TracChangeset
for help on using the changeset viewer.