Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (188186 => 188187)
--- trunk/Source/_javascript_Core/ChangeLog 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-08-08 05:39:06 UTC (rev 188187)
@@ -1,3 +1,15 @@
+2015-08-07 Gyuyoung Kim <[email protected]>
+
+ Reduce uses of PassRefPtr in bindings
+ https://bugs.webkit.org/show_bug.cgi?id=147781
+
+ Reviewed by Chris Dumez.
+
+ Use RefPtr when function can return null or an instance. If not, Ref is used.
+
+ * runtime/JSGenericTypedArrayView.h:
+ (JSC::toNativeTypedView):
+
2015-08-07 Alex Christensen <[email protected]>
Build more testing binaries with CMake on Windows
Modified: trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayView.h (188186 => 188187)
--- trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayView.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/_javascript_Core/runtime/JSGenericTypedArrayView.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -260,11 +260,11 @@
};
template<typename Adaptor>
-inline PassRefPtr<typename Adaptor::ViewType> toNativeTypedView(JSValue value)
+inline RefPtr<typename Adaptor::ViewType> toNativeTypedView(JSValue value)
{
typename Adaptor::JSViewType* wrapper = jsDynamicCast<typename Adaptor::JSViewType*>(value);
if (!wrapper)
- return 0;
+ return nullptr;
return wrapper->typedImpl();
}
Modified: trunk/Source/WebCore/ChangeLog (188186 => 188187)
--- trunk/Source/WebCore/ChangeLog 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/ChangeLog 2015-08-08 05:39:06 UTC (rev 188187)
@@ -1,3 +1,68 @@
+2015-08-07 Gyuyoung Kim <[email protected]>
+
+ Reduce uses of PassRefPtr in bindings
+ https://bugs.webkit.org/show_bug.cgi?id=147781
+
+ Reviewed by Chris Dumez.
+
+ Use RefPtr when function can return null or an instance. If not, Ref is used.
+
+ * bindings/gobject/GObjectNodeFilterCondition.h:
+ * bindings/gobject/GObjectXPathNSResolver.h:
+ * bindings/gobject/WebKitDOMNodeFilter.cpp:
+ (WebKit::core):
+ * bindings/gobject/WebKitDOMNodeFilterPrivate.h:
+ * bindings/gobject/WebKitDOMXPathNSResolver.cpp:
+ (WebKit::core):
+ * bindings/gobject/WebKitDOMXPathNSResolverPrivate.h:
+ * bindings/js/CallbackFunction.h:
+ (WebCore::createFunctionOnlyCallback):
+ * bindings/js/Dictionary.h:
+ (WebCore::Dictionary::getEventListener):
+ * bindings/js/IDBBindingUtilities.cpp:
+ (WebCore::createIDBKeyFromValue):
+ (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
+ (WebCore::createIDBKeyFromScriptValueAndKeyPath):
+ (WebCore::scriptValueToIDBKey):
+ * bindings/js/IDBBindingUtilities.h:
+ * bindings/js/JSDOMBinding.h:
+ (WebCore::toInt8Array):
+ (WebCore::toInt16Array):
+ (WebCore::toInt32Array):
+ (WebCore::toUint8Array):
+ (WebCore::toUint8ClampedArray):
+ (WebCore::toUint16Array):
+ (WebCore::toUint32Array):
+ (WebCore::toFloat32Array):
+ (WebCore::toFloat64Array):
+ * bindings/js/JSDOMStringListCustom.cpp:
+ (WebCore::JSDOMStringList::toWrapped):
+ * bindings/js/JSDeviceMotionEventCustom.cpp:
+ (WebCore::readAccelerationArgument):
+ (WebCore::readRotationRateArgument):
+ * bindings/js/JSErrorHandler.h:
+ (WebCore::createJSErrorHandler):
+ * bindings/js/JSGeolocationCustom.cpp:
+ (WebCore::createPositionOptions):
+ * bindings/js/JSNodeCustom.cpp:
+ * bindings/js/JSNodeFilterCustom.cpp:
+ (WebCore::JSNodeFilter::toWrapped):
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::createWorld):
+ (WebCore::ScriptController::createRootObject):
+ (WebCore::ScriptController::createScriptInstanceForWidget):
+ * bindings/js/ScriptController.h:
+ * bindings/js/ScriptControllerMac.mm:
+ (WebCore::ScriptController::createScriptInstanceForWidget):
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::SerializedScriptValue::create):
+ * bindings/js/SerializedScriptValue.h:
+ * bindings/objc/DOMUIKitExtensions.mm:
+ (-[DOMNode rangeOfContainingParagraph]):
+ * bindings/objc/ObjCNodeFilterCondition.h:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateHeader):
+
2015-08-07 Myles C. Maxfield <[email protected]>
[OS X] Remove dead code from FontCache::createFontPlatformData()
Modified: trunk/Source/WebCore/bindings/gobject/GObjectNodeFilterCondition.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/gobject/GObjectNodeFilterCondition.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/gobject/GObjectNodeFilterCondition.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -22,7 +22,6 @@
#include "NodeFilterCondition.h"
#include "WebKitDOMNodeFilter.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RetainPtr.h>
#include <wtf/glib/GRefPtr.h>
Modified: trunk/Source/WebCore/bindings/gobject/GObjectXPathNSResolver.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/gobject/GObjectXPathNSResolver.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/gobject/GObjectXPathNSResolver.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -21,7 +21,6 @@
#include "WebKitDOMXPathNSResolver.h"
#include "XPathNSResolver.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/glib/GRefPtr.h>
namespace WebCore {
Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMNodeFilter.cpp (188186 => 188187)
--- trunk/Source/WebCore/bindings/gobject/WebKitDOMNodeFilter.cpp 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMNodeFilter.cpp 2015-08-08 05:39:06 UTC (rev 188187)
@@ -65,7 +65,7 @@
return nodeFilterMap().get(coreNodeFilter);
}
-PassRefPtr<WebCore::NodeFilter> core(WebKitDOMNodeFilter* nodeFilter)
+RefPtr<WebCore::NodeFilter> core(WebKitDOMNodeFilter* nodeFilter)
{
if (!nodeFilter)
return nullptr;
Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMNodeFilterPrivate.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/gobject/WebKitDOMNodeFilterPrivate.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMNodeFilterPrivate.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -21,7 +21,6 @@
#define WebKitDOMNodeFilterPrivate_h
#include <webkitdom/WebKitDOMNodeFilter.h>
-#include <wtf/PassRefPtr.h>
namespace WebCore {
class NodeFilter;
@@ -29,7 +28,7 @@
namespace WebKit {
WebKitDOMNodeFilter* kit(WebCore::NodeFilter*);
-PassRefPtr<WebCore::NodeFilter> core(WebKitDOMNodeFilter*);
+RefPtr<WebCore::NodeFilter> core(WebKitDOMNodeFilter*);
} // namespace WebKit
#endif /* WebKitDOMNodeFilterPrivate_h */
Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMXPathNSResolver.cpp (188186 => 188187)
--- trunk/Source/WebCore/bindings/gobject/WebKitDOMXPathNSResolver.cpp 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMXPathNSResolver.cpp 2015-08-08 05:39:06 UTC (rev 188187)
@@ -108,7 +108,7 @@
namespace WebKit {
-PassRefPtr<WebCore::XPathNSResolver> core(WebKitDOMXPathNSResolver* xPathNSResolver)
+RefPtr<WebCore::XPathNSResolver> core(WebKitDOMXPathNSResolver* xPathNSResolver)
{
if (!xPathNSResolver)
return nullptr;
@@ -118,7 +118,7 @@
coreResolver = core(WEBKIT_DOM_NATIVE_XPATH_NS_RESOLVER(xPathNSResolver));
else
coreResolver = WebCore::GObjectXPathNSResolver::create(xPathNSResolver);
- return coreResolver.release();
+ return coreResolver;
}
WebKitDOMXPathNSResolver* kit(WebCore::XPathNSResolver* coreXPathNSResolver)
Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMXPathNSResolverPrivate.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/gobject/WebKitDOMXPathNSResolverPrivate.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMXPathNSResolverPrivate.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -23,7 +23,6 @@
#include "XPathNSResolver.h"
#include <webkitdom/WebKitDOMXPathNSResolver.h>
-#include <wtf/PassRefPtr.h>
#define WEBKIT_DOM_TYPE_NATIVE_XPATH_NS_RESOLVER (webkit_dom_native_xpath_ns_resolver_get_type())
#define WEBKIT_DOM_NATIVE_XPATH_NS_RESOLVER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_DOM_TYPE_NATIVE_XPATH_NS_RESOLVER, WebKitDOMNativeXPathNSResolver))
@@ -36,7 +35,7 @@
typedef struct _WebKitDOMNativeXPathNSResolverClass WebKitDOMNativeXPathNSResolverClass;
namespace WebKit {
-PassRefPtr<WebCore::XPathNSResolver> core(WebKitDOMXPathNSResolver*);
+RefPtr<WebCore::XPathNSResolver> core(WebKitDOMXPathNSResolver*);
WebKitDOMXPathNSResolver* kit(WebCore::XPathNSResolver*);
WebCore::XPathNSResolver* core(WebKitDOMNativeXPathNSResolver*);
} // namespace WebKit
Modified: trunk/Source/WebCore/bindings/js/CallbackFunction.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/CallbackFunction.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/CallbackFunction.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -46,11 +46,11 @@
// Creates callback objects for callbacks marked as FunctionOnly in WebIDL.
template <typename JSCallbackType>
-PassRefPtr<JSCallbackType> createFunctionOnlyCallback(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, JSC::JSValue value, CallbackAllowedValueFlags acceptedValues = 0)
+RefPtr<JSCallbackType> createFunctionOnlyCallback(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, JSC::JSValue value, CallbackAllowedValueFlags acceptedValues = 0)
{
if (checkFunctionOnlyCallback(exec, value, acceptedValues))
return JSCallbackType::create(asObject(value), globalObject);
- return 0;
+ return nullptr;
}
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/Dictionary.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/Dictionary.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/Dictionary.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -53,9 +53,9 @@
bool get(const String& propertyName, Result&) const;
template <typename T>
- PassRefPtr<EventListener> getEventListener(const char* propertyName, T* target) const;
+ RefPtr<EventListener> getEventListener(const char* propertyName, T* target) const;
template <typename T>
- PassRefPtr<EventListener> getEventListener(const String& propertyName, T* target) const;
+ RefPtr<EventListener> getEventListener(const String& propertyName, T* target) const;
bool isObject() const { return m_dictionary.isValid(); }
bool isUndefinedOrNull() const { return !m_dictionary.isValid(); }
@@ -86,24 +86,24 @@
}
template <typename T>
-PassRefPtr<EventListener> Dictionary::getEventListener(const char* propertyName, T* target) const
+RefPtr<EventListener> Dictionary::getEventListener(const char* propertyName, T* target) const
{
if (!m_dictionary.isValid())
- return 0;
+ return nullptr;
Deprecated::ScriptValue eventListener;
if (!m_dictionary.tryGetProperty(propertyName, eventListener))
- return 0;
+ return nullptr;
if (eventListener.hasNoValue())
- return 0;
+ return nullptr;
if (!eventListener.isObject())
- return 0;
+ return nullptr;
return JSEventListener::create(asObject(eventListener.jsValue()), asJSObject(target), true, currentWorld(m_dictionary.execState()));
}
template <typename T>
-PassRefPtr<EventListener> Dictionary::getEventListener(const String& propertyName, T* target) const
+RefPtr<EventListener> Dictionary::getEventListener(const String& propertyName, T* target) const
{
return getEventListener(propertyName.utf8().data(), target);
}
Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp 2015-08-08 05:39:06 UTC (rev 188187)
@@ -114,7 +114,7 @@
static const size_t maximumDepth = 2000;
-static PassRefPtr<IDBKey> createIDBKeyFromValue(ExecState* exec, JSValue value, Vector<JSArray*>& stack)
+static RefPtr<IDBKey> createIDBKeyFromValue(ExecState* exec, JSValue value, Vector<JSArray*>& stack)
{
if (value.isNumber() && !std::isnan(value.toNumber(exec)))
return IDBKey::createNumber(value.toNumber(exec));
@@ -129,9 +129,9 @@
size_t length = array->length();
if (stack.contains(array))
- return 0;
+ return nullptr;
if (stack.size() >= maximumDepth)
- return 0;
+ return nullptr;
stack.append(array);
IDBKey::KeyArray subkeys;
@@ -148,10 +148,10 @@
return IDBKey::createArray(subkeys);
}
}
- return 0;
+ return nullptr;
}
-static PassRefPtr<IDBKey> createIDBKeyFromValue(ExecState* exec, JSValue value)
+static RefPtr<IDBKey> createIDBKeyFromValue(ExecState* exec, JSValue value)
{
Vector<JSArray*> stack;
RefPtr<IDBKey> key = createIDBKeyFromValue(exec, value, stack);
@@ -182,7 +182,7 @@
return currentValue;
}
-static PassRefPtr<IDBKey> internalCreateIDBKeyFromScriptValueAndKeyPath(ExecState* exec, const Deprecated::ScriptValue& value, const String& keyPath)
+static RefPtr<IDBKey> internalCreateIDBKeyFromScriptValueAndKeyPath(ExecState* exec, const Deprecated::ScriptValue& value, const String& keyPath)
{
Vector<String> keyPathElements;
IDBKeyPathParseError error;
@@ -192,7 +192,7 @@
JSValue jsValue = value.jsValue();
jsValue = getNthValueOnKeyPath(exec, jsValue, keyPathElements, keyPathElements.size());
if (jsValue.isUndefined())
- return 0;
+ return nullptr;
return createIDBKeyFromValue(exec, jsValue);
}
@@ -258,7 +258,7 @@
return true;
}
-PassRefPtr<IDBKey> createIDBKeyFromScriptValueAndKeyPath(ExecState* exec, const Deprecated::ScriptValue& value, const IDBKeyPath& keyPath)
+RefPtr<IDBKey> createIDBKeyFromScriptValueAndKeyPath(ExecState* exec, const Deprecated::ScriptValue& value, const IDBKeyPath& keyPath)
{
LOG(StorageAPI, "createIDBKeyFromScriptValueAndKeyPath");
ASSERT(!keyPath.isNull());
@@ -269,7 +269,7 @@
for (size_t i = 0; i < array.size(); i++) {
RefPtr<IDBKey> key = internalCreateIDBKeyFromScriptValueAndKeyPath(exec, value, array[i]);
if (!key)
- return 0;
+ return nullptr;
result.append(key);
}
return IDBKey::createArray(result);
@@ -344,7 +344,7 @@
return Deprecated::ScriptValue(exec->vm(), idbKeyToJSValue(exec, jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject()), key.get()));
}
-PassRefPtr<IDBKey> scriptValueToIDBKey(DOMRequestState* requestState, const Deprecated::ScriptValue& scriptValue)
+RefPtr<IDBKey> scriptValueToIDBKey(DOMRequestState* requestState, const Deprecated::ScriptValue& scriptValue)
{
ExecState* exec = requestState->exec();
return createIDBKeyFromValue(exec, scriptValue.jsValue());
Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -45,13 +45,13 @@
IDBKeyPath idbKeyPathFromValue(JSC::ExecState*, JSC::JSValue);
bool injectIDBKeyIntoScriptValue(DOMRequestState*, PassRefPtr<IDBKey>, Deprecated::ScriptValue&, const IDBKeyPath&);
-PassRefPtr<IDBKey> createIDBKeyFromScriptValueAndKeyPath(JSC::ExecState*, const Deprecated::ScriptValue&, const IDBKeyPath&);
+RefPtr<IDBKey> createIDBKeyFromScriptValueAndKeyPath(JSC::ExecState*, const Deprecated::ScriptValue&, const IDBKeyPath&);
bool canInjectIDBKeyIntoScriptValue(DOMRequestState*, const Deprecated::ScriptValue&, const IDBKeyPath&);
Deprecated::ScriptValue deserializeIDBValue(DOMRequestState*, PassRefPtr<SerializedScriptValue>);
Deprecated::ScriptValue deserializeIDBValueBuffer(DOMRequestState*, PassRefPtr<SharedBuffer>, bool keyIsDefined);
WEBCORE_EXPORT Deprecated::ScriptValue deserializeIDBValueBuffer(JSC::ExecState*, const Vector<uint8_t>&, bool keyIsDefined);
Deprecated::ScriptValue idbKeyToScriptValue(DOMRequestState*, PassRefPtr<IDBKey>);
-PassRefPtr<IDBKey> scriptValueToIDBKey(DOMRequestState*, const Deprecated::ScriptValue&);
+RefPtr<IDBKey> scriptValueToIDBKey(DOMRequestState*, const Deprecated::ScriptValue&);
WEBCORE_EXPORT void generateIndexKeysForValue(JSC::ExecState*, const IDBIndexMetadata&, const Deprecated::ScriptValue& objectValue, Vector<IDBKeyData>& indexKeys);
}
Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -465,15 +465,15 @@
return wrapper->impl();
}
-inline PassRefPtr<JSC::Int8Array> toInt8Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Int8Adaptor>(value); }
-inline PassRefPtr<JSC::Int16Array> toInt16Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Int16Adaptor>(value); }
-inline PassRefPtr<JSC::Int32Array> toInt32Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Int32Adaptor>(value); }
-inline PassRefPtr<JSC::Uint8Array> toUint8Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Uint8Adaptor>(value); }
-inline PassRefPtr<JSC::Uint8ClampedArray> toUint8ClampedArray(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Uint8ClampedAdaptor>(value); }
-inline PassRefPtr<JSC::Uint16Array> toUint16Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Uint16Adaptor>(value); }
-inline PassRefPtr<JSC::Uint32Array> toUint32Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Uint32Adaptor>(value); }
-inline PassRefPtr<JSC::Float32Array> toFloat32Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Float32Adaptor>(value); }
-inline PassRefPtr<JSC::Float64Array> toFloat64Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Float64Adaptor>(value); }
+inline RefPtr<JSC::Int8Array> toInt8Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Int8Adaptor>(value); }
+inline RefPtr<JSC::Int16Array> toInt16Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Int16Adaptor>(value); }
+inline RefPtr<JSC::Int32Array> toInt32Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Int32Adaptor>(value); }
+inline RefPtr<JSC::Uint8Array> toUint8Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Uint8Adaptor>(value); }
+inline RefPtr<JSC::Uint8ClampedArray> toUint8ClampedArray(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Uint8ClampedAdaptor>(value); }
+inline RefPtr<JSC::Uint16Array> toUint16Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Uint16Adaptor>(value); }
+inline RefPtr<JSC::Uint32Array> toUint32Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Uint32Adaptor>(value); }
+inline RefPtr<JSC::Float32Array> toFloat32Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Float32Adaptor>(value); }
+inline RefPtr<JSC::Float64Array> toFloat64Array(JSC::JSValue value) { return JSC::toNativeTypedView<JSC::Float64Adaptor>(value); }
template<typename T> struct NativeValueTraits;
Modified: trunk/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/JSDOMStringListCustom.cpp 2015-08-08 05:39:06 UTC (rev 188187)
@@ -26,20 +26,20 @@
namespace WebCore {
-PassRefPtr<DOMStringList> JSDOMStringList::toWrapped(ExecState* exec, JSValue value)
+RefPtr<DOMStringList> JSDOMStringList::toWrapped(ExecState* exec, JSValue value)
{
if (value.inherits(JSDOMStringList::info()))
return &jsCast<JSDOMStringList*>(asObject(value))->impl();
if (!isJSArray(value))
- return 0;
+ return nullptr;
JSArray* array = asArray(value);
RefPtr<DOMStringList> stringList = DOMStringList::create();
for (unsigned i = 0; i < array->length(); ++i)
stringList->append(array->getIndex(exec, i).toString(exec)->value(exec));
- return stringList.release();
+ return stringList;
}
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp 2015-08-08 05:39:06 UTC (rev 188187)
@@ -40,78 +40,78 @@
namespace WebCore {
-static PassRefPtr<DeviceMotionData::Acceleration> readAccelerationArgument(JSValue value, ExecState* exec)
+static RefPtr<DeviceMotionData::Acceleration> readAccelerationArgument(JSValue value, ExecState* exec)
{
if (value.isUndefinedOrNull())
- return 0;
+ return nullptr;
// Given the above test, this will always yield an object.
JSObject* object = value.toObject(exec);
JSValue xValue = object->get(exec, Identifier::fromString(exec, "x"));
if (exec->hadException())
- return 0;
+ return nullptr;
bool canProvideX = !xValue.isUndefinedOrNull();
double x = xValue.toNumber(exec);
if (exec->hadException())
- return 0;
+ return nullptr;
JSValue yValue = object->get(exec, Identifier::fromString(exec, "y"));
if (exec->hadException())
- return 0;
+ return nullptr;
bool canProvideY = !yValue.isUndefinedOrNull();
double y = yValue.toNumber(exec);
if (exec->hadException())
- return 0;
+ return nullptr;
JSValue zValue = object->get(exec, Identifier::fromString(exec, "z"));
if (exec->hadException())
- return 0;
+ return nullptr;
bool canProvideZ = !zValue.isUndefinedOrNull();
double z = zValue.toNumber(exec);
if (exec->hadException())
- return 0;
+ return nullptr;
if (!canProvideX && !canProvideY && !canProvideZ)
- return 0;
+ return nullptr;
return DeviceMotionData::Acceleration::create(canProvideX, x, canProvideY, y, canProvideZ, z);
}
-static PassRefPtr<DeviceMotionData::RotationRate> readRotationRateArgument(JSValue value, ExecState* exec)
+static RefPtr<DeviceMotionData::RotationRate> readRotationRateArgument(JSValue value, ExecState* exec)
{
if (value.isUndefinedOrNull())
- return 0;
+ return nullptr;
// Given the above test, this will always yield an object.
JSObject* object = value.toObject(exec);
JSValue alphaValue = object->get(exec, Identifier::fromString(exec, "alpha"));
if (exec->hadException())
- return 0;
+ return nullptr;
bool canProvideAlpha = !alphaValue.isUndefinedOrNull();
double alpha = alphaValue.toNumber(exec);
if (exec->hadException())
- return 0;
+ return nullptr;
JSValue betaValue = object->get(exec, Identifier::fromString(exec, "beta"));
if (exec->hadException())
- return 0;
+ return nullptr;
bool canProvideBeta = !betaValue.isUndefinedOrNull();
double beta = betaValue.toNumber(exec);
if (exec->hadException())
- return 0;
+ return nullptr;
JSValue gammaValue = object->get(exec, Identifier::fromString(exec, "gamma"));
if (exec->hadException())
- return 0;
+ return nullptr;
bool canProvideGamma = !gammaValue.isUndefinedOrNull();
double gamma = gammaValue.toNumber(exec);
if (exec->hadException())
- return 0;
+ return nullptr;
if (!canProvideAlpha && !canProvideBeta && !canProvideGamma)
- return 0;
+ return nullptr;
return DeviceMotionData::RotationRate::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
}
Modified: trunk/Source/WebCore/bindings/js/JSErrorHandler.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/JSErrorHandler.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/JSErrorHandler.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -51,10 +51,10 @@
// Creates a JS EventListener for "onerror" event handler in worker context. It has custom implementation because
// unlike other event listeners it accepts three parameters.
-inline PassRefPtr<JSErrorHandler> createJSErrorHandler(JSC::ExecState* exec, JSC::JSValue listener, JSC::JSObject* wrapper)
+inline RefPtr<JSErrorHandler> createJSErrorHandler(JSC::ExecState* exec, JSC::JSValue listener, JSC::JSObject* wrapper)
{
if (!listener.isObject())
- return 0;
+ return nullptr;
return JSErrorHandler::create(asObject(listener), wrapper, true, currentWorld(exec));
}
Modified: trunk/Source/WebCore/bindings/js/JSGeolocationCustom.cpp (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/JSGeolocationCustom.cpp 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/JSGeolocationCustom.cpp 2015-08-08 05:39:06 UTC (rev 188187)
@@ -69,7 +69,7 @@
}
-static PassRefPtr<PositionOptions> createPositionOptions(ExecState* exec, JSValue value)
+static RefPtr<PositionOptions> createPositionOptions(ExecState* exec, JSValue value)
{
// Create default options.
RefPtr<PositionOptions> options = PositionOptions::create();
@@ -77,7 +77,7 @@
// Argument is optional (hence undefined is allowed), and null is allowed.
if (value.isUndefinedOrNull()) {
// Use default options.
- return options.release();
+ return options;
}
// Given the above test, this will always yield an object.
@@ -87,13 +87,13 @@
JSDictionary dictionary(exec, object);
if (!dictionary.tryGetProperty("enableHighAccuracy", options.get(), setEnableHighAccuracy))
- return 0;
+ return nullptr;
if (!dictionary.tryGetProperty("timeout", options.get(), setTimeout))
- return 0;
+ return nullptr;
if (!dictionary.tryGetProperty("maximumAge", options.get(), setMaximumAge))
- return 0;
+ return nullptr;
- return options.release();
+ return options;
}
JSValue JSGeolocation::getCurrentPosition(ExecState* exec)
Modified: trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp 2015-08-08 05:39:06 UTC (rev 188187)
@@ -67,7 +67,6 @@
#include "StyleSheet.h"
#include "StyledElement.h"
#include "Text.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
using namespace JSC;
Modified: trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/JSNodeFilterCustom.cpp 2015-08-08 05:39:06 UTC (rev 188187)
@@ -35,14 +35,14 @@
visitor.addOpaqueRoot(&impl());
}
-PassRefPtr<NodeFilter> JSNodeFilter::toWrapped(JSC::VM& vm, JSC::JSValue value)
+RefPtr<NodeFilter> JSNodeFilter::toWrapped(JSC::VM& vm, JSC::JSValue value)
{
if (value.inherits(JSNodeFilter::info()))
return &JSC::jsCast<JSNodeFilter*>(asObject(value))->impl();
RefPtr<NodeFilter> result = NodeFilter::create();
result->setCondition(JSNodeFilterCondition::create(vm, result.get(), value));
- return result.release();
+ return result;
}
} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/ScriptController.cpp 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp 2015-08-08 05:39:06 UTC (rev 188187)
@@ -180,7 +180,7 @@
return evaluateInWorld(sourceCode, mainThreadNormalWorld());
}
-PassRefPtr<DOMWrapperWorld> ScriptController::createWorld()
+Ref<DOMWrapperWorld> ScriptController::createWorld()
{
return DOMWrapperWorld::create(JSDOMWindow::commonVM());
}
@@ -375,7 +375,7 @@
return m_bindingRootObject.get();
}
-PassRefPtr<Bindings::RootObject> ScriptController::createRootObject(void* nativeHandle)
+RefPtr<Bindings::RootObject> ScriptController::createRootObject(void* nativeHandle)
{
RootObjectMap::iterator it = m_rootObjects.find(nativeHandle);
if (it != m_rootObjects.end())
@@ -384,7 +384,7 @@
RefPtr<Bindings::RootObject> rootObject = Bindings::RootObject::create(nativeHandle, globalObject(pluginWorld()));
m_rootObjects.set(nativeHandle, rootObject);
- return rootObject.release();
+ return rootObject;
}
void ScriptController::collectIsolatedContexts(Vector<std::pair<JSC::ExecState*, SecurityOrigin*>>& result)
@@ -432,7 +432,7 @@
#endif
#if !PLATFORM(COCOA)
-PassRefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget(Widget* widget)
+RefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget(Widget* widget)
{
if (!is<PluginViewBase>(*widget))
return nullptr;
Modified: trunk/Source/WebCore/bindings/js/ScriptController.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/ScriptController.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/ScriptController.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -77,7 +77,7 @@
explicit ScriptController(Frame&);
~ScriptController();
- WEBCORE_EXPORT static PassRefPtr<DOMWrapperWorld> createWorld();
+ WEBCORE_EXPORT static Ref<DOMWrapperWorld> createWorld();
JSDOMWindowShell* createWindowShell(DOMWrapperWorld&);
void destroyWindowShell(DOMWrapperWorld&);
@@ -146,11 +146,11 @@
void updatePlatformScriptObjects();
- PassRefPtr<JSC::Bindings::Instance> createScriptInstanceForWidget(Widget*);
+ RefPtr<JSC::Bindings::Instance> createScriptInstanceForWidget(Widget*);
JSC::Bindings::RootObject* bindingRootObject();
JSC::Bindings::RootObject* cacheableBindingRootObject();
- WEBCORE_EXPORT PassRefPtr<JSC::Bindings::RootObject> createRootObject(void* nativeHandle);
+ WEBCORE_EXPORT RefPtr<JSC::Bindings::RootObject> createRootObject(void* nativeHandle);
void collectIsolatedContexts(Vector<std::pair<JSC::ExecState*, SecurityOrigin*>>&);
Modified: trunk/Source/WebCore/bindings/js/ScriptControllerMac.mm (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/ScriptControllerMac.mm 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/ScriptControllerMac.mm 2015-08-08 05:39:06 UTC (rev 188187)
@@ -60,11 +60,11 @@
namespace WebCore {
-PassRefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget(Widget* widget)
+RefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget(Widget* widget)
{
NSView* widgetView = widget->platformWidget();
if (!widgetView)
- return 0;
+ return nullptr;
RefPtr<RootObject> rootObject = createRootObject(widgetView);
@@ -74,25 +74,25 @@
if ([widgetView respondsToSelector:@selector(objectForWebScript)]) {
id objectForWebScript = [widgetView objectForWebScript];
if (!objectForWebScript)
- return 0;
+ return nullptr;
return JSC::Bindings::ObjcInstance::create(objectForWebScript, rootObject.release());
}
if ([widgetView respondsToSelector:@selector(createPluginScriptableObject)]) {
#if !ENABLE(NETSCAPE_PLUGIN_API)
- return 0;
+ return nullptr;
#else
NPObject* npObject = [widgetView createPluginScriptableObject];
if (!npObject)
- return 0;
+ return nullptr;
RefPtr<Instance> instance = JSC::Bindings::CInstance::create(npObject, rootObject.release());
// -createPluginScriptableObject returns a retained NPObject. The caller is expected to release it.
_NPN_ReleaseObject(npObject);
- return instance.release();
+ return instance;
#endif
}
- return 0;
+ return nullptr;
}
WebScriptObject* ScriptController::windowScriptObject()
Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp 2015-08-08 05:39:06 UTC (rev 188187)
@@ -2695,7 +2695,7 @@
}
#endif
-PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(JSContextRef originContext, JSValueRef apiValue, JSValueRef* exception)
+RefPtr<SerializedScriptValue> SerializedScriptValue::create(JSContextRef originContext, JSValueRef apiValue, JSValueRef* exception)
{
ExecState* exec = toJS(originContext);
JSLockHolder locker(exec);
@@ -2705,10 +2705,10 @@
if (exception)
*exception = toRef(exec, exec->exception()->value());
exec->clearException();
- return 0;
+ return nullptr;
}
ASSERT(serializedValue);
- return serializedValue.release();
+ return serializedValue;
}
String SerializedScriptValue::toString()
Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -33,7 +33,6 @@
#include <runtime/ArrayBuffer.h>
#include <runtime/JSCJSValue.h>
#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
@@ -84,7 +83,7 @@
String toString();
// API implementation helpers. These don't expose special behavior for ArrayBuffers or MessagePorts.
- WEBCORE_EXPORT static PassRefPtr<SerializedScriptValue> create(JSContextRef, JSValueRef, JSValueRef* exception);
+ WEBCORE_EXPORT static RefPtr<SerializedScriptValue> create(JSContextRef, JSValueRef, JSValueRef* exception);
WEBCORE_EXPORT JSValueRef deserialize(JSContextRef, JSValueRef* exception);
const Vector<uint8_t>& data() const { return m_data; }
Modified: trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm (188186 => 188187)
--- trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/objc/DOMUIKitExtensions.mm 2015-08-08 05:39:06 UTC (rev 188187)
@@ -231,8 +231,8 @@
Position paragraphEnd = visibleParagraphEnd.deepEquivalent().parentAnchoredEquivalent();
if (paragraphStart.isNotNull() && paragraphEnd.isNotNull()) {
- PassRefPtr<Range> range = Range::create(*node->ownerDocument(), paragraphStart, paragraphEnd);
- result = kit(range.get());
+ Ref<Range> range = Range::create(*node->ownerDocument(), paragraphStart, paragraphEnd);
+ result = kit(range.ptr());
}
return result;
Modified: trunk/Source/WebCore/bindings/objc/ObjCNodeFilterCondition.h (188186 => 188187)
--- trunk/Source/WebCore/bindings/objc/ObjCNodeFilterCondition.h 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/objc/ObjCNodeFilterCondition.h 2015-08-08 05:39:06 UTC (rev 188187)
@@ -29,7 +29,6 @@
#include "NodeFilterCondition.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RetainPtr.h>
@protocol DOMNodeFilter;
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (188186 => 188187)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2015-08-08 04:08:16 UTC (rev 188186)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2015-08-08 05:39:06 UTC (rev 188187)
@@ -900,9 +900,9 @@
# JSValue to implementation type
if (!$hasParent || $interface->extendedAttributes->{"JSGenerateToNativeObject"}) {
if ($interfaceName eq "NodeFilter") {
- push(@headerContent, " static PassRefPtr<NodeFilter> toWrapped(JSC::VM&, JSC::JSValue);\n");
+ push(@headerContent, " static RefPtr<NodeFilter> toWrapped(JSC::VM&, JSC::JSValue);\n");
} elsif ($interfaceName eq "DOMStringList") {
- push(@headerContent, " static PassRefPtr<DOMStringList> toWrapped(JSC::ExecState*, JSC::JSValue);\n");
+ push(@headerContent, " static RefPtr<DOMStringList> toWrapped(JSC::ExecState*, JSC::JSValue);\n");
} else {
push(@headerContent, " static $implType* toWrapped(JSC::JSValue);\n");
}