Changeset 61467 in webkit


Ignore:
Timestamp:
Jun 19, 2010 12:05:45 AM (14 years ago)
Author:
aa@chromium.org
Message:

2010-06-19 Aaron Boodman <aa@chromium.org>

Unreviewed, rolling out r61466.
http://trac.webkit.org/changeset/61466
https://bugs.webkit.org/show_bug.cgi?id=40816

Landed wrong change

  • bindings/v8/V8DOMWindowShell.cpp: (WebCore::V8DOMWindowShell::initContextIfNeeded):
  • bindings/v8/V8DOMWindowShell.h:

2010-06-19 Aaron Boodman <aa@chromium.org>

Unreviewed, rolling out r61466.
http://trac.webkit.org/changeset/61466
https://bugs.webkit.org/show_bug.cgi?id=40816

Landed wrong change

  • src/WebKit.cpp: (WebKit::shutdown):
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r61466 r61467  
     12010-06-19  Aaron Boodman  <aa@chromium.org>
     2
     3        Unreviewed, rolling out r61466.
     4        http://trac.webkit.org/changeset/61466
     5        https://bugs.webkit.org/show_bug.cgi?id=40816
     6
     7        Landed wrong change
     8
     9        * bindings/v8/V8DOMWindowShell.cpp:
     10        (WebCore::V8DOMWindowShell::initContextIfNeeded):
     11        * bindings/v8/V8DOMWindowShell.h:
     12
    1132010-06-18  Aaron Boodman  <aa@chromium.org>
    214
  • trunk/WebCore/bindings/v8/V8DOMWindowShell.cpp

    r61466 r61467  
    117117        V8Proxy::reportUnsafeAccessTo(target, V8Proxy::ReportLater);
    118118}
    119 
    120 bool V8DOMWindowShell::s_isV8Initialized = false;
    121119
    122120PassRefPtr<V8DOMWindowShell> V8DOMWindowShell::create(Frame* frame)
     
    250248    v8::HandleScope handleScope;
    251249
    252     initializeV8IfNeeded();
     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
    253269
    254270    m_context = createNewContext(m_global, 0);
     
    293309}
    294310
    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 
    332311v8::Persistent<v8::Context> V8DOMWindowShell::createNewContext(v8::Handle<v8::Object> global, int extensionGroup)
    333312{
  • trunk/WebCore/bindings/v8/V8DOMWindowShell.h

    r61466 r61467  
    5151public:
    5252    static PassRefPtr<V8DOMWindowShell> create(Frame*);
    53     static void initializeV8IfNeeded();
    54     static void uninitializeV8IfNeeded();
    5553
    5654    v8::Handle<v8::Context> context() const { return m_context; }
     
    122120    v8::Persistent<v8::Object> m_global;
    123121    v8::Persistent<v8::Object> m_document;
    124 
    125     static bool s_isV8Initialized;
    126122};
    127123
  • trunk/WebKit/chromium/ChangeLog

    r61466 r61467  
     12010-06-19  Aaron Boodman  <aa@chromium.org>
     2
     3        Unreviewed, rolling out r61466.
     4        http://trac.webkit.org/changeset/61466
     5        https://bugs.webkit.org/show_bug.cgi?id=40816
     6
     7        Landed wrong change
     8
     9        * src/WebKit.cpp:
     10        (WebKit::shutdown):
     11
    1122010-06-18  Aaron Boodman  <aa@chromium.org>
    213
  • trunk/WebKit/chromium/src/WebKit.cpp

    r61466 r61467  
    4242#include "WorkerContextExecutionProxy.h"
    4343
    44 #if USE(V8)
    45 #include "V8DOMWindowShell.h"
    46 #endif
    47 
    4844#include <wtf/Assertions.h>
    4945#include <wtf/Threading.h>
     
    8379void shutdown()
    8480{
    85 #if USE(V8)
    86     WebCore::V8DOMWindowShell::uninitializeV8IfNeeded();
    87 #endif
    8881    s_webKitClient = 0;
    8982}
Note: See TracChangeset for help on using the changeset viewer.