diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/bindings/v8/custom/V8DocumentCustom.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/bindings/v8/custom/V8DocumentCustom.cpp | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/chromium/third_party/WebKit/Source/bindings/v8/custom/V8DocumentCustom.cpp b/chromium/third_party/WebKit/Source/bindings/v8/custom/V8DocumentCustom.cpp index 94ed248cb90..930ba77f07d 100644 --- a/chromium/third_party/WebKit/Source/bindings/v8/custom/V8DocumentCustom.cpp +++ b/chromium/third_party/WebKit/Source/bindings/v8/custom/V8DocumentCustom.cpp @@ -29,16 +29,16 @@ */ #include "config.h" -#include "V8Document.h" +#include "bindings/core/v8/V8Document.h" -#include "V8CanvasRenderingContext2D.h" -#include "V8DOMImplementation.h" -#include "V8Node.h" -#include "V8Touch.h" -#include "V8TouchList.h" -#include "V8WebGLRenderingContext.h" -#include "V8XPathNSResolver.h" -#include "V8XPathResult.h" +#include "bindings/core/v8/V8CanvasRenderingContext2D.h" +#include "bindings/core/v8/V8DOMImplementation.h" +#include "bindings/core/v8/V8Node.h" +#include "bindings/core/v8/V8Touch.h" +#include "bindings/core/v8/V8TouchList.h" +#include "bindings/core/v8/V8WebGLRenderingContext.h" +#include "bindings/core/v8/V8XPathNSResolver.h" +#include "bindings/core/v8/V8XPathResult.h" #include "bindings/v8/ExceptionMessages.h" #include "bindings/v8/ExceptionState.h" #include "bindings/v8/ScriptController.h" @@ -49,8 +49,8 @@ #include "core/dom/ExceptionCode.h" #include "core/dom/Node.h" #include "core/dom/TouchList.h" +#include "core/frame/LocalFrame.h" #include "core/html/canvas/CanvasRenderingContext.h" -#include "core/frame/Frame.h" #include "core/xml/DocumentXPathEvaluator.h" #include "core/xml/XPathNSResolver.h" #include "core/xml/XPathResult.h" @@ -60,27 +60,23 @@ namespace WebCore { void V8Document::evaluateMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info) { - RefPtr<Document> document = V8Document::toNative(info.Holder()); + RefPtrWillBeRawPtr<Document> document = V8Document::toNative(info.Holder()); + ASSERT(document); ExceptionState exceptionState(ExceptionState::ExecutionContext, "evaluate", "Document", info.Holder(), info.GetIsolate()); - V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, expression, info[0]); - RefPtr<Node> contextNode; - if (V8Node::hasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate()))) - contextNode = V8Node::toNative(v8::Handle<v8::Object>::Cast(info[1])); + TOSTRING_VOID(V8StringResource<>, expression, info[0]); + RefPtrWillBeRawPtr<Node> contextNode = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[1]); const int resolverArgumentIndex = 2; - RefPtr<XPathNSResolver> resolver = toXPathNSResolver(info[resolverArgumentIndex], info.GetIsolate()); + RefPtrWillBeRawPtr<XPathNSResolver> resolver = toXPathNSResolver(info[resolverArgumentIndex], info.GetIsolate()); if (!resolver && !isUndefinedOrNull(info[resolverArgumentIndex])) { - exceptionState.throwTypeError(ExceptionMessages::incorrectArgumentType(resolverArgumentIndex + 1, "is not a resolver function.")); + exceptionState.throwTypeError(ExceptionMessages::argumentNullOrIncorrectType(resolverArgumentIndex + 1, "XPathNSResolver")); exceptionState.throwIfNeeded(); return; } int type = toInt32(info[3]); - RefPtr<XPathResult> inResult; - if (V8XPathResult::hasInstance(info[4], info.GetIsolate(), worldType(info.GetIsolate()))) - inResult = V8XPathResult::toNative(v8::Handle<v8::Object>::Cast(info[4])); - - V8TRYCATCH_VOID(RefPtr<XPathResult>, result, DocumentXPathEvaluator::evaluate(document.get(), expression, contextNode.get(), resolver.release(), type, inResult.get(), exceptionState)); + RefPtrWillBeRawPtr<XPathResult> inResult = V8XPathResult::toNativeWithTypeCheck(info.GetIsolate(), info[4]); + TONATIVE_VOID(RefPtrWillBeRawPtr<XPathResult>, result, DocumentXPathEvaluator::evaluate(*document, expression, contextNode.get(), resolver.release(), type, inResult.get(), exceptionState)); if (exceptionState.throwIfNeeded()) return; |