Title: [126375] trunk/Source/WebCore
- Revision
- 126375
- Author
- [email protected]
- Date
- 2012-08-22 18:12:54 -0700 (Wed, 22 Aug 2012)
Log Message
[V8] Remove V8Proxy from getXPathNSResolver()
https://bugs.webkit.org/show_bug.cgi?id=94715
Reviewed by Adam Barth.
- The V8Proxy* argument of getXPathNSResolver(..., V8Proxy* = 0) is not used.
We can remove it.
- We can rename getXPathNSResolver() to toXPathNSResolver().
- We can move toXPathNSResolver() from V8DOMWrapper to V8Binding,
since other toXXX() methods are written in V8Binding.
- Change the return value of toXPathNSResolver() from RefPtr to PassRefPtr.
No tests. No change in behavior.
* bindings/scripts/CodeGeneratorV8.pm:
(JSValueToNative):
* bindings/v8/V8Binding.cpp:
(WebCore::toXPathNSResolver):
(WebCore):
* bindings/v8/V8Binding.h:
(WebCore):
* bindings/v8/V8DOMWrapper.cpp:
* bindings/v8/V8DOMWrapper.h:
(V8DOMWrapper):
* bindings/v8/custom/V8DocumentCustom.cpp:
(WebCore::V8Document::evaluateCallback):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (126374 => 126375)
--- trunk/Source/WebCore/ChangeLog 2012-08-23 01:08:25 UTC (rev 126374)
+++ trunk/Source/WebCore/ChangeLog 2012-08-23 01:12:54 UTC (rev 126375)
@@ -1,3 +1,35 @@
+2012-08-22 Kentaro Hara <[email protected]>
+
+ [V8] Remove V8Proxy from getXPathNSResolver()
+ https://bugs.webkit.org/show_bug.cgi?id=94715
+
+ Reviewed by Adam Barth.
+
+ - The V8Proxy* argument of getXPathNSResolver(..., V8Proxy* = 0) is not used.
+ We can remove it.
+
+ - We can rename getXPathNSResolver() to toXPathNSResolver().
+
+ - We can move toXPathNSResolver() from V8DOMWrapper to V8Binding,
+ since other toXXX() methods are written in V8Binding.
+
+ - Change the return value of toXPathNSResolver() from RefPtr to PassRefPtr.
+
+ No tests. No change in behavior.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (JSValueToNative):
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::toXPathNSResolver):
+ (WebCore):
+ * bindings/v8/V8Binding.h:
+ (WebCore):
+ * bindings/v8/V8DOMWrapper.cpp:
+ * bindings/v8/V8DOMWrapper.h:
+ (V8DOMWrapper):
+ * bindings/v8/custom/V8DocumentCustom.cpp:
+ (WebCore::V8Document::evaluateCallback):
+
2012-08-22 Kenneth Russell <[email protected]>
Unreviewed, rolling out r126325.
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (126374 => 126375)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-08-23 01:08:25 UTC (rev 126374)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm 2012-08-23 01:12:54 UTC (rev 126375)
@@ -3815,7 +3815,7 @@
}
if ($type eq "XPathNSResolver") {
- return "V8DOMWrapper::getXPathNSResolver($value)";
+ return "toXPathNSResolver($value)";
}
my $arrayType = $codeGenerator->GetArrayType($type);
Modified: trunk/Source/WebCore/bindings/v8/V8Binding.cpp (126374 => 126375)
--- trunk/Source/WebCore/bindings/v8/V8Binding.cpp 2012-08-23 01:08:25 UTC (rev 126374)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.cpp 2012-08-23 01:12:54 UTC (rev 126375)
@@ -43,8 +43,10 @@
#include "V8DOMWindow.h"
#include "V8Element.h"
#include "V8ObjectConstructor.h"
+#include "V8XPathNSResolver.h"
#include "WorkerContext.h"
#include "WorkerContextExecutionProxy.h"
+#include "XPathNSResolver.h"
#include <wtf/MathExtras.h>
#include <wtf/MainThread.h>
@@ -240,6 +242,16 @@
return ret.release();
}
+PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value> value)
+{
+ RefPtr<XPathNSResolver> resolver;
+ if (V8XPathNSResolver::HasInstance(value))
+ resolver = V8XPathNSResolver::toNative(v8::Handle<v8::Object>::Cast(value));
+ else if (value->IsObject())
+ resolver = V8CustomXPathNSResolver::create(value->ToObject());
+ return resolver;
+}
+
DOMWindow* toDOMWindow(v8::Handle<v8::Context> context)
{
v8::Handle<v8::Object> global = context->Global();
Modified: trunk/Source/WebCore/bindings/v8/V8Binding.h (126374 => 126375)
--- trunk/Source/WebCore/bindings/v8/V8Binding.h 2012-08-23 01:08:25 UTC (rev 126374)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.h 2012-08-23 01:12:54 UTC (rev 126375)
@@ -354,6 +354,7 @@
v8::Persistent<v8::FunctionTemplate> createRawTemplate();
PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value>);
+ PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>);
// Returns the window object associated with a context.
DOMWindow* toDOMWindow(v8::Handle<v8::Context>);
Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp (126374 => 126375)
--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp 2012-08-23 01:08:25 UTC (rev 126374)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp 2012-08-23 01:12:54 UTC (rev 126375)
@@ -55,12 +55,10 @@
#include "V8Proxy.h"
#include "V8StyleSheet.h"
#include "V8WorkerContextEventListener.h"
-#include "V8XPathNSResolver.h"
#include "WebGLContextAttributes.h"
#include "WebGLUniformLocation.h"
#include "WorkerContextExecutionProxy.h"
#include "WrapperTypeInfo.h"
-#include "XPathNSResolver.h"
#include <algorithm>
#include <utility>
#include <v8-debug.h>
@@ -281,16 +279,4 @@
#endif
}
-// XPath-related utilities
-RefPtr<XPathNSResolver> V8DOMWrapper::getXPathNSResolver(v8::Handle<v8::Value> value, V8Proxy* proxy)
-{
- RefPtr<XPathNSResolver> resolver;
- if (V8XPathNSResolver::HasInstance(value))
- resolver = V8XPathNSResolver::toNative(v8::Handle<v8::Object>::Cast(value));
- else if (value->IsObject())
- resolver = V8CustomXPathNSResolver::create(value->ToObject());
- return resolver;
-}
-
-
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h (126374 => 126375)
--- trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h 2012-08-23 01:08:25 UTC (rev 126374)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h 2012-08-23 01:12:54 UTC (rev 126375)
@@ -93,9 +93,6 @@
static PassRefPtr<EventListener> getEventListener(v8::Local<v8::Value> value, bool isAttribute, ListenerLookupType lookup);
- // XPath-related utilities
- static RefPtr<XPathNSResolver> getXPathNSResolver(v8::Handle<v8::Value> value, V8Proxy* proxy = 0);
-
// Wrap JS node filter in C++.
static PassRefPtr<NodeFilter> wrapNativeNodeFilter(v8::Handle<v8::Value>);
Modified: trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp (126374 => 126375)
--- trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp 2012-08-23 01:08:25 UTC (rev 126374)
+++ trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp 2012-08-23 01:12:54 UTC (rev 126375)
@@ -76,7 +76,7 @@
if (V8Node::HasInstance(args[1]))
contextNode = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1]));
- RefPtr<XPathNSResolver> resolver = V8DOMWrapper::getXPathNSResolver(args[2]);
+ RefPtr<XPathNSResolver> resolver = toXPathNSResolver(args[2]);
if (!resolver && !args[2]->IsNull() && !args[2]->IsUndefined())
return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes