Chromium Code Reviews| Index: Source/bindings/v8/V8NodeFilterCondition.cpp |
| diff --git a/Source/bindings/v8/V8NodeFilterCondition.cpp b/Source/bindings/v8/V8NodeFilterCondition.cpp |
| index 107b558bf6a8d8dfd9b4e250c29cc6bc61cbe59a..72fa37cb3d5a4bd85adc242fe544225e0a1eb16f 100644 |
| --- a/Source/bindings/v8/V8NodeFilterCondition.cpp |
| +++ b/Source/bindings/v8/V8NodeFilterCondition.cpp |
| @@ -33,7 +33,6 @@ |
| #include "V8Node.h" |
| #include "bindings/v8/ScriptController.h" |
| -#include "bindings/v8/ScriptState.h" |
| #include "bindings/v8/V8HiddenValue.h" |
| #include "core/dom/Node.h" |
| #include "core/dom/NodeFilter.h" |
| @@ -52,9 +51,9 @@ V8NodeFilterCondition::~V8NodeFilterCondition() |
| { |
| } |
| -short V8NodeFilterCondition::acceptNode(ScriptState* state, Node* node) const |
| +short V8NodeFilterCondition::acceptNode(Node* node, ExceptionState& exceptionState) const |
| { |
| - v8::Isolate* isolate = state->isolate(); |
| + v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
|
dcarney
2014/04/04 12:14:43
please cache isolate from constructor and use it h
haraken
2014/04/04 12:21:37
Done. I cached NewScriptState, which is exactly wh
|
| ASSERT(isolate->InContext()); |
| v8::HandleScope handleScope(isolate); |
| v8::Handle<v8::Value> filter = m_filter.newLocal(isolate); |
| @@ -72,20 +71,20 @@ short V8NodeFilterCondition::acceptNode(ScriptState* state, Node* node) const |
| else { |
| v8::Local<v8::Value> value = filter->ToObject()->Get(v8AtomicString(isolate, "acceptNode")); |
| if (value.IsEmpty() || !value->IsFunction()) { |
| - throwTypeError("NodeFilter object does not have an acceptNode function", state->isolate()); |
| + throwTypeError("NodeFilter object does not have an acceptNode function", isolate); |
| return NodeFilter::FILTER_REJECT; |
| } |
| callback = v8::Handle<v8::Function>::Cast(value); |
| } |
| OwnPtr<v8::Handle<v8::Value>[]> info = adoptArrayPtr(new v8::Handle<v8::Value>[1]); |
| - info[0] = toV8(node, v8::Handle<v8::Object>(), state->isolate()); |
| + info[0] = toV8(node, v8::Handle<v8::Object>(), isolate); |
| v8::Handle<v8::Object> object = isolate->GetCurrentContext()->Global(); |
|
haraken
2014/04/04 12:21:37
So I changed this to m_scriptState->context().
|
| - v8::Handle<v8::Value> result = ScriptController::callFunction(state->executionContext(), callback, object, 1, info.get(), isolate); |
| + v8::Handle<v8::Value> result = ScriptController::callFunction(currentExecutionContext(isolate), callback, object, 1, info.get(), isolate); |
|
haraken
2014/04/04 12:21:37
I changed this to m_scriptState->executionContext(
|
| if (exceptionCatcher.HasCaught()) { |
| - state->setException(exceptionCatcher.Exception()); |
| + exceptionState.rethrowV8Exception(exceptionCatcher.Exception()); |
| return NodeFilter::FILTER_REJECT; |
| } |