Diff
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (197314 => 197315)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog 2016-02-29 07:36:03 UTC (rev 197314)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog 2016-02-29 07:36:23 UTC (rev 197315)
@@ -1,3 +1,55 @@
+2016-02-28 Gyuyoung Kim <[email protected]>
+
+ Reduce uses of PassRefPtr in indexeddb
+ https://bugs.webkit.org/show_bug.cgi?id=154273
+
+ Reviewed by Darin Adler.
+
+ No new tests, no behavior changes.
+
+ * Modules/indexeddb/IDBDatabaseError.h:
+ (WebCore::IDBDatabaseError::create):
+ * Modules/indexeddb/IDBKeyData.cpp:
+ (WebCore::IDBKeyData::maybeCreateIDBKey):
+ * Modules/indexeddb/IDBKeyData.h:
+ * Modules/indexeddb/IDBKeyRange.cpp:
+ (WebCore::IDBKeyRange::create):
+ (WebCore::IDBKeyRange::IDBKeyRange):
+ (WebCore::IDBKeyRange::only):
+ (WebCore::IDBKeyRange::lowerBound):
+ (WebCore::IDBKeyRange::upperBound):
+ (WebCore::IDBKeyRange::bound):
+ * Modules/indexeddb/IDBKeyRange.h:
+ (WebCore::IDBKeyRange::create):
+ (WebCore::IDBKeyRange::lower):
+ (WebCore::IDBKeyRange::upper):
+ (WebCore::IDBKeyRange::lowerBound):
+ (WebCore::IDBKeyRange::upperBound):
+ (WebCore::IDBKeyRange::bound):
+ * Modules/indexeddb/IDBKeyRangeData.cpp:
+ (WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange):
+ * Modules/indexeddb/IDBKeyRangeData.h:
+ * Modules/indexeddb/IDBServerConnection.h:
+ * Modules/indexeddb/legacy/IDBCallbacks.h:
+ * Modules/indexeddb/legacy/IDBCursorBackend.cpp:
+ (WebCore::IDBCursorBackend::continueFunction):
+ * Modules/indexeddb/legacy/IDBCursorBackend.h:
+ * Modules/indexeddb/legacy/IDBCursorBackendOperations.h:
+ (WebCore::CursorIterationOperation::create):
+ (WebCore::CursorIterationOperation::CursorIterationOperation):
+ * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
+ (WebCore::GetOperation::perform):
+ (WebCore::PutOperation::perform):
+ * Modules/indexeddb/legacy/LegacyCursor.cpp:
+ (WebCore::LegacyCursor::continueFunction):
+ * Modules/indexeddb/legacy/LegacyCursor.h:
+ * Modules/indexeddb/legacy/LegacyFactory.h:
+ (WebCore::LegacyFactory::create):
+ * Modules/indexeddb/legacy/LegacyRequest.cpp:
+ (WebCore::LegacyRequest::onSuccess):
+ * Modules/indexeddb/legacy/LegacyRequest.h:
+ * inspector/InspectorIndexedDBAgent.cpp:
+
2016-02-26 Brady Eidson <[email protected]>
Modern IDB: New database versions are never committed to SQLite.
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBDatabaseError.h (197314 => 197315)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBDatabaseError.h 2016-02-29 07:36:03 UTC (rev 197314)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBDatabaseError.h 2016-02-29 07:36:23 UTC (rev 197315)
@@ -37,18 +37,18 @@
class IDBDatabaseError : public RefCounted<IDBDatabaseError> {
public:
- static PassRefPtr<IDBDatabaseError> create(unsigned short code)
+ static Ref<IDBDatabaseError> create(unsigned short code)
{
ASSERT(code >= IDBDatabaseException::IDBDatabaseExceptionOffset);
ASSERT(code < IDBDatabaseException::IDBDatabaseExceptionMax);
- return adoptRef(new IDBDatabaseError(code));
+ return adoptRef(*new IDBDatabaseError(code));
}
- static PassRefPtr<IDBDatabaseError> create(unsigned short code, const String& message)
+ static Ref<IDBDatabaseError> create(unsigned short code, const String& message)
{
ASSERT_WITH_MESSAGE(code >= IDBDatabaseException::IDBDatabaseExceptionOffset, "%d >= %d", code, IDBDatabaseException::IDBDatabaseExceptionOffset);
ASSERT(code < IDBDatabaseException::IDBDatabaseExceptionMax);
- return adoptRef(new IDBDatabaseError(code, message));
+ return adoptRef(*new IDBDatabaseError(code, message));
}
~IDBDatabaseError() { }
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp (197314 => 197315)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp 2016-02-29 07:36:03 UTC (rev 197314)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp 2016-02-29 07:36:23 UTC (rev 197315)
@@ -65,7 +65,7 @@
}
}
-PassRefPtr<IDBKey> IDBKeyData::maybeCreateIDBKey() const
+RefPtr<IDBKey> IDBKeyData::maybeCreateIDBKey() const
{
if (m_isNull)
return nullptr;
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyData.h (197314 => 197315)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyData.h 2016-02-29 07:36:03 UTC (rev 197314)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyData.h 2016-02-29 07:36:23 UTC (rev 197315)
@@ -62,7 +62,7 @@
return result;
}
- WEBCORE_EXPORT PassRefPtr<IDBKey> maybeCreateIDBKey() const;
+ WEBCORE_EXPORT RefPtr<IDBKey> maybeCreateIDBKey() const;
IDBKeyData isolatedCopy() const;
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp (197314 => 197315)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp 2016-02-29 07:36:03 UTC (rev 197314)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRange.cpp 2016-02-29 07:36:23 UTC (rev 197315)
@@ -35,15 +35,15 @@
namespace WebCore {
-Ref<IDBKeyRange> IDBKeyRange::create(PassRefPtr<IDBKey> prpKey)
+Ref<IDBKeyRange> IDBKeyRange::create(RefPtr<IDBKey>&& key)
{
- RefPtr<IDBKey> key = prpKey;
- return adoptRef(*new IDBKeyRange(key, key, LowerBoundClosed, UpperBoundClosed));
+ RefPtr<IDBKey> upperBound = key;
+ return adoptRef(*new IDBKeyRange(WTFMove(key), WTFMove(upperBound), LowerBoundClosed, UpperBoundClosed));
}
-IDBKeyRange::IDBKeyRange(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, LowerBoundType lowerType, UpperBoundType upperType)
- : m_lower(lower)
- , m_upper(upper)
+IDBKeyRange::IDBKeyRange(RefPtr<IDBKey>&& lower, RefPtr<IDBKey>&& upper, LowerBoundType lowerType, UpperBoundType upperType)
+ : m_lower(WTFMove(lower))
+ , m_upper(WTFMove(upper))
, m_lowerType(lowerType)
, m_upperType(upperType)
{
@@ -61,54 +61,53 @@
return idbKeyToScriptValue(&requestState, m_upper);
}
-PassRefPtr<IDBKeyRange> IDBKeyRange::only(PassRefPtr<IDBKey> prpKey, ExceptionCode& ec)
+RefPtr<IDBKeyRange> IDBKeyRange::only(RefPtr<IDBKey>&& key, ExceptionCode& ec)
{
- RefPtr<IDBKey> key = prpKey;
if (!key || !key->isValid()) {
ec = IDBDatabaseException::DataError;
- return 0;
+ return nullptr;
}
- return IDBKeyRange::create(key, key, LowerBoundClosed, UpperBoundClosed);
+ return create(WTFMove(key));
}
-PassRefPtr<IDBKeyRange> IDBKeyRange::only(ScriptExecutionContext* context, const Deprecated::ScriptValue& keyValue, ExceptionCode& ec)
+RefPtr<IDBKeyRange> IDBKeyRange::only(ScriptExecutionContext* context, const Deprecated::ScriptValue& keyValue, ExceptionCode& ec)
{
DOMRequestState requestState(context);
RefPtr<IDBKey> key = scriptValueToIDBKey(&requestState, keyValue);
if (!key || !key->isValid()) {
ec = IDBDatabaseException::DataError;
- return 0;
+ return nullptr;
}
- return IDBKeyRange::create(key, key, LowerBoundClosed, UpperBoundClosed);
+ return create(WTFMove(key));
}
-PassRefPtr<IDBKeyRange> IDBKeyRange::lowerBound(ScriptExecutionContext* context, const Deprecated::ScriptValue& boundValue, bool open, ExceptionCode& ec)
+RefPtr<IDBKeyRange> IDBKeyRange::lowerBound(ScriptExecutionContext* context, const Deprecated::ScriptValue& boundValue, bool open, ExceptionCode& ec)
{
DOMRequestState requestState(context);
RefPtr<IDBKey> bound = scriptValueToIDBKey(&requestState, boundValue);
if (!bound || !bound->isValid()) {
ec = IDBDatabaseException::DataError;
- return 0;
+ return nullptr;
}
- return IDBKeyRange::create(bound, 0, open ? LowerBoundOpen : LowerBoundClosed, UpperBoundOpen);
+ return IDBKeyRange::create(WTFMove(bound), nullptr, open ? LowerBoundOpen : LowerBoundClosed, UpperBoundOpen);
}
-PassRefPtr<IDBKeyRange> IDBKeyRange::upperBound(ScriptExecutionContext* context, const Deprecated::ScriptValue& boundValue, bool open, ExceptionCode& ec)
+RefPtr<IDBKeyRange> IDBKeyRange::upperBound(ScriptExecutionContext* context, const Deprecated::ScriptValue& boundValue, bool open, ExceptionCode& ec)
{
DOMRequestState requestState(context);
RefPtr<IDBKey> bound = scriptValueToIDBKey(&requestState, boundValue);
if (!bound || !bound->isValid()) {
ec = IDBDatabaseException::DataError;
- return 0;
+ return nullptr;
}
- return IDBKeyRange::create(0, bound, LowerBoundOpen, open ? UpperBoundOpen : UpperBoundClosed);
+ return IDBKeyRange::create(nullptr, WTFMove(bound), LowerBoundOpen, open ? UpperBoundOpen : UpperBoundClosed);
}
-PassRefPtr<IDBKeyRange> IDBKeyRange::bound(ScriptExecutionContext* context, const Deprecated::ScriptValue& lowerValue, const Deprecated::ScriptValue& upperValue, bool lowerOpen, bool upperOpen, ExceptionCode& ec)
+RefPtr<IDBKeyRange> IDBKeyRange::bound(ScriptExecutionContext* context, const Deprecated::ScriptValue& lowerValue, const Deprecated::ScriptValue& upperValue, bool lowerOpen, bool upperOpen, ExceptionCode& ec)
{
DOMRequestState requestState(context);
RefPtr<IDBKey> lower = scriptValueToIDBKey(&requestState, lowerValue);
@@ -116,18 +115,18 @@
if (!lower || !lower->isValid() || !upper || !upper->isValid()) {
ec = IDBDatabaseException::DataError;
- return 0;
+ return nullptr;
}
if (upper->isLessThan(lower.get())) {
ec = IDBDatabaseException::DataError;
- return 0;
+ return nullptr;
}
if (upper->isEqual(lower.get()) && (lowerOpen || upperOpen)) {
ec = IDBDatabaseException::DataError;
- return 0;
+ return nullptr;
}
- return IDBKeyRange::create(lower, upper, lowerOpen ? LowerBoundOpen : LowerBoundClosed, upperOpen ? UpperBoundOpen : UpperBoundClosed);
+ return IDBKeyRange::create(WTFMove(lower), WTFMove(upper), lowerOpen ? LowerBoundOpen : LowerBoundClosed, upperOpen ? UpperBoundOpen : UpperBoundClosed);
}
bool IDBKeyRange::isOnlyKey() const
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRange.h (197314 => 197315)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRange.h 2016-02-29 07:36:03 UTC (rev 197314)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRange.h 2016-02-29 07:36:23 UTC (rev 197315)
@@ -31,7 +31,6 @@
#include "Dictionary.h"
#include "IDBKey.h"
#include "ScriptWrappable.h"
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
namespace WebCore {
@@ -49,38 +48,38 @@
UpperBoundClosed
};
- static Ref<IDBKeyRange> create(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, LowerBoundType lowerType, UpperBoundType upperType)
+ static Ref<IDBKeyRange> create(RefPtr<IDBKey>&& lower, RefPtr<IDBKey>&& upper, LowerBoundType lowerType, UpperBoundType upperType)
{
- return adoptRef(*new IDBKeyRange(lower, upper, lowerType, upperType));
+ return adoptRef(*new IDBKeyRange(WTFMove(lower), WTFMove(upper), lowerType, upperType));
}
- static Ref<IDBKeyRange> create(PassRefPtr<IDBKey> prpKey);
+ static Ref<IDBKeyRange> create(RefPtr<IDBKey>&&);
~IDBKeyRange() { }
- PassRefPtr<IDBKey> lower() const { return m_lower; }
- PassRefPtr<IDBKey> upper() const { return m_upper; }
+ IDBKey* lower() const { return m_lower.get(); }
+ IDBKey* upper() const { return m_upper.get(); }
Deprecated::ScriptValue lowerValue(ScriptExecutionContext*) const;
Deprecated::ScriptValue upperValue(ScriptExecutionContext*) const;
bool lowerOpen() const { return m_lowerType == LowerBoundOpen; }
bool upperOpen() const { return m_upperType == UpperBoundOpen; }
- static PassRefPtr<IDBKeyRange> only(PassRefPtr<IDBKey> value, ExceptionCode&);
- static PassRefPtr<IDBKeyRange> only(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
+ static RefPtr<IDBKeyRange> only(RefPtr<IDBKey>&& value, ExceptionCode&);
+ static RefPtr<IDBKeyRange> only(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&);
- static PassRefPtr<IDBKeyRange> lowerBound(ScriptExecutionContext* context, const Deprecated::ScriptValue& bound, ExceptionCode& ec) { return lowerBound(context, bound, false, ec); }
- static PassRefPtr<IDBKeyRange> lowerBound(ScriptExecutionContext*, const Deprecated::ScriptValue& bound, bool open, ExceptionCode&);
+ static RefPtr<IDBKeyRange> lowerBound(ScriptExecutionContext* context, const Deprecated::ScriptValue& bound, ExceptionCode& ec) { return lowerBound(context, bound, false, ec); }
+ static RefPtr<IDBKeyRange> lowerBound(ScriptExecutionContext*, const Deprecated::ScriptValue& bound, bool open, ExceptionCode&);
- static PassRefPtr<IDBKeyRange> upperBound(ScriptExecutionContext* context, const Deprecated::ScriptValue& bound, ExceptionCode& ec) { return upperBound(context, bound, false, ec); }
- static PassRefPtr<IDBKeyRange> upperBound(ScriptExecutionContext*, const Deprecated::ScriptValue& bound, bool open, ExceptionCode&);
+ static RefPtr<IDBKeyRange> upperBound(ScriptExecutionContext* context, const Deprecated::ScriptValue& bound, ExceptionCode& ec) { return upperBound(context, bound, false, ec); }
+ static RefPtr<IDBKeyRange> upperBound(ScriptExecutionContext*, const Deprecated::ScriptValue& bound, bool open, ExceptionCode&);
- static PassRefPtr<IDBKeyRange> bound(ScriptExecutionContext* context, const Deprecated::ScriptValue& lower, const Deprecated::ScriptValue& upper, ExceptionCode& ec) { return bound(context, lower, upper, false, false, ec); }
- static PassRefPtr<IDBKeyRange> bound(ScriptExecutionContext* context, const Deprecated::ScriptValue& lower, const Deprecated::ScriptValue& upper, bool lowerOpen, ExceptionCode& ec) { return bound(context, lower, upper, lowerOpen, false, ec); }
- static PassRefPtr<IDBKeyRange> bound(ScriptExecutionContext*, const Deprecated::ScriptValue& lower, const Deprecated::ScriptValue& upper, bool lowerOpen, bool upperOpen, ExceptionCode&);
+ static RefPtr<IDBKeyRange> bound(ScriptExecutionContext* context, const Deprecated::ScriptValue& lower, const Deprecated::ScriptValue& upper, ExceptionCode& ec) { return bound(context, lower, upper, false, false, ec); }
+ static RefPtr<IDBKeyRange> bound(ScriptExecutionContext* context, const Deprecated::ScriptValue& lower, const Deprecated::ScriptValue& upper, bool lowerOpen, ExceptionCode& ec) { return bound(context, lower, upper, lowerOpen, false, ec); }
+ static RefPtr<IDBKeyRange> bound(ScriptExecutionContext*, const Deprecated::ScriptValue& lower, const Deprecated::ScriptValue& upper, bool lowerOpen, bool upperOpen, ExceptionCode&);
WEBCORE_EXPORT bool isOnlyKey() const;
private:
- IDBKeyRange(PassRefPtr<IDBKey> lower, PassRefPtr<IDBKey> upper, LowerBoundType lowerType, UpperBoundType upperType);
+ IDBKeyRange(RefPtr<IDBKey>&& lower, RefPtr<IDBKey>&& upper, LowerBoundType lowerType, UpperBoundType upperType);
RefPtr<IDBKey> m_lower;
RefPtr<IDBKey> m_upper;
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp (197314 => 197315)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp 2016-02-29 07:36:03 UTC (rev 197314)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp 2016-02-29 07:36:23 UTC (rev 197315)
@@ -63,7 +63,7 @@
return result;
}
-PassRefPtr<IDBKeyRange> IDBKeyRangeData::maybeCreateIDBKeyRange() const
+RefPtr<IDBKeyRange> IDBKeyRangeData::maybeCreateIDBKeyRange() const
{
if (isNull)
return nullptr;
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h (197314 => 197315)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h 2016-02-29 07:36:03 UTC (rev 197314)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.h 2016-02-29 07:36:23 UTC (rev 197315)
@@ -63,15 +63,15 @@
if (isNull)
return;
- lowerKey = keyRange->lower().get();
- upperKey = keyRange->upper().get();
+ lowerKey = keyRange->lower();
+ upperKey = keyRange->upper();
lowerOpen = keyRange->lowerOpen();
upperOpen = keyRange->upperOpen();
}
IDBKeyRangeData isolatedCopy() const;
- WEBCORE_EXPORT PassRefPtr<IDBKeyRange> maybeCreateIDBKeyRange() const;
+ WEBCORE_EXPORT RefPtr<IDBKeyRange> maybeCreateIDBKeyRange() const;
WEBCORE_EXPORT bool isExactlyOneKey() const;
bool containsKey(const IDBKeyData&) const;
Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp (197314 => 197315)
--- releases/WebKitGTK/webkit-2.12/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp 2016-02-29 07:36:03 UTC (rev 197314)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp 2016-02-29 07:36:23 UTC (rev 197315)
@@ -311,7 +311,7 @@
return nullptr;
IDBKeyRange::UpperBoundType upperBoundType = upperOpen ? IDBKeyRange::UpperBoundOpen : IDBKeyRange::UpperBoundClosed;
- return IDBKeyRange::create(idbLower, idbUpper, lowerBoundType, upperBoundType);
+ return IDBKeyRange::create(WTFMove(idbLower), WTFMove(idbUpper), lowerBoundType, upperBoundType);
}
class DataLoader;