Changeset 166943 in webkit


Ignore:
Timestamp:
Apr 8, 2014 12:12:37 PM (10 years ago)
Author:
mark.lam@apple.com
Message:

Refactor to make JSMainThreadExecState's constructor and destructor private.
<https://webkit.org/b/131372>

Reviewed by Mark Hahnenberg.

This is in preparation for subsequent patches to ensure that we don't
exit the VM with an exception still pending.

No new tests required. This is only a refactor of existing behavior.

  • bindings/js/JSDOMGlobalObjectTask.cpp:
  • bindings/js/JSMainThreadExecState.h:

(WebCore::JSMainThreadExecState::runTask):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166939 r166943  
     12014-04-08  Mark Lam  <mark.lam@apple.com>
     2
     3        Refactor to make JSMainThreadExecState's constructor and destructor private.
     4        <https://webkit.org/b/131372>
     5
     6        Reviewed by Mark Hahnenberg.
     7
     8        This is in preparation for subsequent patches to ensure that we don't
     9        exit the VM with an exception still pending.
     10
     11        No new tests required.  This is only a refactor of existing behavior.
     12
     13        * bindings/js/JSDOMGlobalObjectTask.cpp:
     14        * bindings/js/JSMainThreadExecState.h:
     15        (WebCore::JSMainThreadExecState::runTask):
     16
    1172014-04-07  Jer Noble  <jer.noble@apple.com>
    218
  • trunk/Source/WebCore/bindings/js/JSDOMGlobalObjectTask.cpp

    r162158 r166943  
    6161        // When on the main thread (e.g. the document's thread), we need to make sure to
    6262        // push the current ExecState on to the JSMainThreadExecState stack.
    63         if (context->isDocument()) {
    64             JSMainThreadExecState currentState(exec);
    65             m_task->run(exec);
    66         } else
     63        if (context->isDocument())
     64            JSMainThreadExecState::runTask(exec, *m_task.get());
     65        else
    6766            m_task->run(exec);
    6867    }
  • trunk/Source/WebCore/bindings/js/JSMainThreadExecState.h

    r161638 r166943  
    2929#include "JSDOMBinding.h"
    3030#include <runtime/Completion.h>
     31#include <runtime/Microtask.h>
    3132#include <wtf/MainThread.h>
    3233
     
    6364    };
    6465
     66    static void runTask(JSC::ExecState* exec, JSC::Microtask& task)
     67    {
     68        JSMainThreadExecState currentState(exec);
     69        task.run(exec);
     70    }
     71
    6572    static InspectorInstrumentationCookie instrumentFunctionCall(ScriptExecutionContext*, JSC::CallType, const JSC::CallData&);
    6673
     74private:
    6775    explicit JSMainThreadExecState(JSC::ExecState* exec)
    6876        : m_previousState(s_mainThreadState)
     
    8492    }
    8593
    86 private:
    8794    static JSC::ExecState* s_mainThreadState;
    8895    JSC::ExecState* m_previousState;
Note: See TracChangeset for help on using the changeset viewer.