Changeset 140392 in webkit


Ignore:
Timestamp:
Jan 22, 2013, 12:32:01 AM (12 years ago)
Author:
haraken@chromium.org
Message:

[V8] Pass an Isolate to toV8()
https://bugs.webkit.org/show_bug.cgi?id=107512

Reviewed by Adam Barth.

By using Context::GetIsolate(), this patch passes an Isolate to toV8().

No tests. No change in behavior.

  • bindings/v8/IDBBindingUtilities.cpp:

(WebCore::injectIDBKeyIntoScriptValue):
(WebCore::idbKeyToScriptValue):

  • bindings/v8/ScriptController.cpp:

(WebCore::createScriptObject):
(WebCore::ScriptController::createScriptObjectForPluginElement):

  • bindings/v8/ScriptDebugServer.cpp:

(WebCore::ScriptDebugServer::currentCallFrame):

  • bindings/v8/ScriptObject.cpp:

(WebCore::ScriptGlobalObject::set):

  • bindings/v8/V8AbstractEventListener.cpp:

(WebCore::V8AbstractEventListener::handleEvent):

  • bindings/v8/V8DOMWindowShell.cpp:

(WebCore::V8DOMWindowShell::updateDocumentProperty):

  • bindings/v8/V8MutationCallback.cpp:

(WebCore::V8MutationCallback::handleEvent):

  • bindings/v8/V8NodeFilterCondition.cpp:

(WebCore::V8NodeFilterCondition::acceptNode):

  • bindings/v8/V8WorkerContextEventListener.cpp:

(WebCore::V8WorkerContextEventListener::handleEvent):

  • bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:

(WebCore::V8SQLStatementErrorCallback::handleEvent):

  • bindings/v8/custom/V8InjectedScriptHostCustom.cpp:

(WebCore::InjectedScriptHost::nodeAsScriptValue):

Location:
trunk/Source/WebCore
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140391 r140392  
     12013-01-22  Kentaro Hara  <haraken@chromium.org>
     2
     3        [V8] Pass an Isolate to toV8()
     4        https://bugs.webkit.org/show_bug.cgi?id=107512
     5
     6        Reviewed by Adam Barth.
     7
     8        By using Context::GetIsolate(), this patch passes an Isolate to toV8().
     9
     10        No tests. No change in behavior.
     11
     12        * bindings/v8/IDBBindingUtilities.cpp:
     13        (WebCore::injectIDBKeyIntoScriptValue):
     14        (WebCore::idbKeyToScriptValue):
     15        * bindings/v8/ScriptController.cpp:
     16        (WebCore::createScriptObject):
     17        (WebCore::ScriptController::createScriptObjectForPluginElement):
     18        * bindings/v8/ScriptDebugServer.cpp:
     19        (WebCore::ScriptDebugServer::currentCallFrame):
     20        * bindings/v8/ScriptObject.cpp:
     21        (WebCore::ScriptGlobalObject::set):
     22        * bindings/v8/V8AbstractEventListener.cpp:
     23        (WebCore::V8AbstractEventListener::handleEvent):
     24        * bindings/v8/V8DOMWindowShell.cpp:
     25        (WebCore::V8DOMWindowShell::updateDocumentProperty):
     26        * bindings/v8/V8MutationCallback.cpp:
     27        (WebCore::V8MutationCallback::handleEvent):
     28        * bindings/v8/V8NodeFilterCondition.cpp:
     29        (WebCore::V8NodeFilterCondition::acceptNode):
     30        * bindings/v8/V8WorkerContextEventListener.cpp:
     31        (WebCore::V8WorkerContextEventListener::handleEvent):
     32        * bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
     33        (WebCore::V8SQLStatementErrorCallback::handleEvent):
     34        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
     35        (WebCore::InjectedScriptHost::nodeAsScriptValue):
     36
    1372013-01-22  Sergey Ryazanov  <serya@chromium.org>
    238
  • trunk/Source/WebCore/bindings/v8/IDBBindingUtilities.cpp

    r139900 r140392  
    2929#if ENABLE(INDEXED_DATABASE)
    3030
     31#include "DOMRequestState.h"
    3132#include "IDBKey.h"
    3233#include "IDBKeyPath.h"
     
    222223}
    223224
    224 bool injectIDBKeyIntoScriptValue(DOMRequestState*, PassRefPtr<IDBKey> key, ScriptValue& value, const IDBKeyPath& keyPath)
     225bool injectIDBKeyIntoScriptValue(DOMRequestState* state, PassRefPtr<IDBKey> key, ScriptValue& value, const IDBKeyPath& keyPath)
    225226{
    226227    IDB_TRACE("injectIDBKeyIntoScriptValue");
     
    242243        return false;
    243244
    244     if (!set(parent, keyPathElements.last(), toV8(key.get(), v8::Handle<v8::Object>())))
     245    if (!set(parent, keyPathElements.last(), toV8(key.get(), v8::Handle<v8::Object>(), state->context()->GetIsolate())))
    245246        return false;
    246247
     
    268269    ASSERT(v8::Context::InContext());
    269270    v8::HandleScope handleScope;
    270     v8::Handle<v8::Value> v8Value(toV8(key.get(), v8::Handle<v8::Object>()));
     271    v8::Handle<v8::Value> v8Value(toV8(key.get(), v8::Handle<v8::Object>(), state->context()->GetIsolate()));
    271272    return ScriptValue(v8Value);
    272273}
  • trunk/Source/WebCore/bindings/v8/ScriptController.cpp

    r139900 r140392  
    617617    v8::Context::Scope scope(v8Context);
    618618    DOMWindow* window = frame->document()->domWindow();
    619     v8::Handle<v8::Value> global = toV8(window, v8::Handle<v8::Object>());
     619    v8::Handle<v8::Value> global = toV8(window, v8::Handle<v8::Object>(), v8Context->GetIsolate());
    620620    ASSERT(global->IsObject());
    621621    return npCreateV8ScriptObject(0, v8::Handle<v8::Object>::Cast(global), window);
     
    657657
    658658    DOMWindow* window = m_frame->document()->domWindow();
    659     v8::Handle<v8::Value> v8plugin = toV8(static_cast<HTMLEmbedElement*>(plugin), v8::Handle<v8::Object>());
     659    v8::Handle<v8::Value> v8plugin = toV8(static_cast<HTMLEmbedElement*>(plugin), v8::Handle<v8::Object>(), v8Context->GetIsolate());
    660660    if (!v8plugin->IsObject())
    661661        return createNoScriptObject();
  • trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp

    r139900 r140392  
    386386    RefPtr<JavaScriptCallFrame> currentCallFrame = JavaScriptCallFrame::create(v8::Debug::GetDebugContext(), v8::Handle<v8::Object>::Cast(currentCallFrameV8));
    387387    v8::Context::Scope contextScope(m_pausedContext);
    388     return ScriptValue(toV8(currentCallFrame.release(), v8::Handle<v8::Object>()));
     388    return ScriptValue(toV8(currentCallFrame.release(), v8::Handle<v8::Object>(), m_pausedContext->GetIsolate()));
    389389}
    390390
  • trunk/Source/WebCore/bindings/v8/ScriptObject.cpp

    r139900 r140392  
    7474{
    7575    ScriptScope scope(scriptState);
    76     scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8::Object>()));
     76    scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8::Object>(), scriptState->isolate()));
    7777    return scope.success();
    7878}
     
    8181{
    8282    ScriptScope scope(scriptState);
    83     scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8::Object>()));
     83    scope.global()->Set(v8::String::NewSymbol(name), toV8(value, v8::Handle<v8::Object>(), scriptState->isolate()));
    8484    return scope.success();
    8585}
  • trunk/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp

    r139900 r140392  
    9797
    9898    // Get the V8 wrapper for the event object.
    99     v8::Handle<v8::Value> jsEvent = toV8(event, v8::Handle<v8::Object>());
     99    v8::Handle<v8::Value> jsEvent = toV8(event, v8::Handle<v8::Object>(), v8Context->GetIsolate());
    100100    ASSERT(!jsEvent.IsEmpty());
    101101
  • trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp

    r140288 r140392  
    355355    v8::Context::Scope contextScope(m_context.get());
    356356
    357     v8::Handle<v8::Value> documentWrapper = toV8(m_frame->document(), v8::Handle<v8::Object>());
     357    v8::Handle<v8::Value> documentWrapper = toV8(m_frame->document(), v8::Handle<v8::Object>(), m_context.get()->GetIsolate());
    358358    ASSERT(documentWrapper == m_document.get() || m_document.isEmpty());
    359359    if (m_document.isEmpty())
  • trunk/Source/WebCore/bindings/v8/V8MutationCallback.cpp

    r139900 r140392  
    6464    v8::Local<v8::Array> mutationsArray = v8::Array::New(mutations->size());
    6565    for (size_t i = 0; i < mutations->size(); ++i)
    66         mutationsArray->Set(deprecatedV8Integer(i), toV8(mutations->at(i).get(), v8::Handle<v8::Object>()));
     66        mutationsArray->Set(deprecatedV8Integer(i), toV8(mutations->at(i).get(), v8::Handle<v8::Object>(), v8Context->GetIsolate()));
    6767
    68     v8::Handle<v8::Value> observerHandle = toV8(observer, v8::Handle<v8::Object>());
     68    v8::Handle<v8::Value> observerHandle = toV8(observer, v8::Handle<v8::Object>(), v8Context->GetIsolate());
    6969    if (observerHandle.IsEmpty()) {
    7070        if (!isScriptControllerTerminating())
  • trunk/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp

    r139900 r140392  
    7171    }
    7272
     73    OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::Value>[1]);
     74    args[0] = toV8(node, v8::Handle<v8::Object>(), state->isolate());
     75
    7376    v8::Handle<v8::Object> object = v8::Context::GetCurrent()->Global();
    74     OwnArrayPtr<v8::Handle<v8::Value> > args = adoptArrayPtr(new v8::Handle<v8::Value>[1]);
    75     args[0] = toV8(node, v8::Handle<v8::Object>());
    76 
    7777    v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumentation(0, callback, object, 1, args.get());
    7878
  • trunk/Source/WebCore/bindings/v8/V8WorkerContextEventListener.cpp

    r139900 r140392  
    7676
    7777    // Get the V8 wrapper for the event object.
    78     v8::Handle<v8::Value> jsEvent = toV8(event, v8::Handle<v8::Object>());
     78    v8::Handle<v8::Value> jsEvent = toV8(event, v8::Handle<v8::Object>(), v8Context->GetIsolate());
    7979
    8080    invokeEventHandler(context, event, jsEvent);
  • trunk/Source/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp

    r139900 r140392  
    5656    v8::Context::Scope scope(v8Context);
    5757
    58     v8::Handle<v8::Value> transactionHandle = toV8(transaction, v8::Handle<v8::Object>());
    59     v8::Handle<v8::Value> errorHandle = toV8(error, v8::Handle<v8::Object>());
     58    v8::Handle<v8::Value> transactionHandle = toV8(transaction, v8::Handle<v8::Object>(), v8Context->GetIsolate());
     59    v8::Handle<v8::Value> errorHandle = toV8(error, v8::Handle<v8::Object>(), v8Context->GetIsolate());
    6060    if (transactionHandle.IsEmpty() || errorHandle.IsEmpty()) {
    6161        if (!isScriptControllerTerminating())
  • trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp

    r139900 r140392  
    7777    if (!BindingSecurity::shouldAllowAccessToNode(BindingState::instance(), node))
    7878        return ScriptValue(v8::Null());
    79     return ScriptValue(toV8(node, v8::Handle<v8::Object>()));
     79    return ScriptValue(toV8(node, v8::Handle<v8::Object>(), context->GetIsolate()));
    8080}
    8181
Note: See TracChangeset for help on using the changeset viewer.