Diff
Modified: trunk/Source/WebCore/ChangeLog (236006 => 236007)
--- trunk/Source/WebCore/ChangeLog 2018-09-14 15:37:14 UTC (rev 236006)
+++ trunk/Source/WebCore/ChangeLog 2018-09-14 16:38:19 UTC (rev 236007)
@@ -1,3 +1,62 @@
+2018-09-14 David Kilzer <[email protected]>
+
+ REGRESSION (r235954): Fix build failure on watchOS
+ <https://webkit.org/b/189605>
+
+ Reviewed by Geoffrey Garen.
+
+ Remove `using WebCore::IndexedDB::KeyType;` from
+ Source/WebCore/Modules/indexeddb/IDBKey.h and fix all the
+ resulting build failures.
+
+ * Modules/indexeddb/IDBKey.cpp:
+ (WebCore::IDBKey::IDBKey):
+ (WebCore::IDBKey::isValid const):
+ (WebCore::IDBKey::compare const):
+ * Modules/indexeddb/IDBKey.h:
+ (WebCore::IDBKey::createNumber):
+ (WebCore::IDBKey::createDate):
+ (WebCore::IDBKey::type const):
+ (WebCore::IDBKey::array const):
+ (WebCore::IDBKey::string const):
+ (WebCore::IDBKey::date const):
+ (WebCore::IDBKey::number const):
+ (WebCore::IDBKey::binary const):
+ (WebCore::IDBKey::compareTypes):
+ (WebCore::IDBKey::IDBKey):
+ * Modules/indexeddb/IDBKeyData.cpp:
+ (WebCore::IDBKeyData::IDBKeyData):
+ (WebCore::IDBKeyData::maybeCreateIDBKey const):
+ (WebCore::IDBKeyData::isolatedCopy):
+ (WebCore::IDBKeyData::encode const):
+ (WebCore::IDBKeyData::decode):
+ (WebCore::IDBKeyData::compare const):
+ (WebCore::IDBKeyData::loggingString const):
+ (WebCore::IDBKeyData::setArrayValue):
+ (WebCore::IDBKeyData::setBinaryValue):
+ (WebCore::IDBKeyData::setStringValue):
+ (WebCore::IDBKeyData::setDateValue):
+ (WebCore::IDBKeyData::setNumberValue):
+ (WebCore::IDBKeyData::isValid const):
+ (WebCore::IDBKeyData::operator== const):
+ * Modules/indexeddb/IDBKeyData.h:
+ (WebCore::IDBKeyData::IDBKeyData):
+ (WebCore::IDBKeyData::minimum):
+ (WebCore::IDBKeyData::maximum):
+ (WebCore::IDBKeyData::type const):
+ (WebCore::IDBKeyData::hash const):
+ (WebCore::IDBKeyData::string const):
+ (WebCore::IDBKeyData::date const):
+ (WebCore::IDBKeyData::number const):
+ (WebCore::IDBKeyData::binary const):
+ (WebCore::IDBKeyData::array const):
+ (WebCore::IDBKeyData::encode const):
+ (WebCore::IDBKeyData::decode):
+ * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+ (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
+ * bindings/js/IDBBindingUtilities.cpp:
+ (WebCore::toJS):
+
2018-09-14 Xabier Rodriguez Calvar <[email protected]>
[EME] Add support the waitingforkey event
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp (236006 => 236007)
--- trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp 2018-09-14 15:37:14 UTC (rev 236006)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp 2018-09-14 16:38:19 UTC (rev 236007)
@@ -55,7 +55,7 @@
return adoptRef(*new IDBKey(ThreadSafeDataBuffer::copyData(bufferView->data(), bufferView->byteLength())));
}
-IDBKey::IDBKey(KeyType type, double number)
+IDBKey::IDBKey(IndexedDB::KeyType type, double number)
: m_type(type)
, m_value(number)
, m_sizeEstimate(OverheadSize + sizeof(double))
@@ -63,7 +63,7 @@
}
IDBKey::IDBKey(const String& value)
- : m_type(KeyType::String)
+ : m_type(IndexedDB::KeyType::String)
, m_value(value)
, m_sizeEstimate(OverheadSize + value.length() * sizeof(UChar))
{
@@ -70,7 +70,7 @@
}
IDBKey::IDBKey(const IDBKeyVector& keyArray, size_t arraySize)
- : m_type(KeyType::Array)
+ : m_type(IndexedDB::KeyType::Array)
, m_value(keyArray)
, m_sizeEstimate(OverheadSize + arraySize)
{
@@ -77,7 +77,7 @@
}
IDBKey::IDBKey(const ThreadSafeDataBuffer& buffer)
- : m_type(KeyType::Binary)
+ : m_type(IndexedDB::KeyType::Binary)
, m_value(buffer)
, m_sizeEstimate(OverheadSize + buffer.size())
{
@@ -87,10 +87,10 @@
bool IDBKey::isValid() const
{
- if (m_type == KeyType::Invalid)
+ if (m_type == IndexedDB::KeyType::Invalid)
return false;
- if (m_type == KeyType::Array) {
+ if (m_type == IndexedDB::KeyType::Array) {
for (auto& key : WTF::get<IDBKeyVector>(m_value)) {
if (!key->isValid())
return false;
@@ -106,7 +106,7 @@
return m_type > other.m_type ? -1 : 1;
switch (m_type) {
- case KeyType::Array: {
+ case IndexedDB::KeyType::Array: {
auto& array = WTF::get<IDBKeyVector>(m_value);
auto& otherArray = WTF::get<IDBKeyVector>(other.m_value);
for (size_t i = 0; i < array.size() && i < otherArray.size(); ++i) {
@@ -119,19 +119,19 @@
return 1;
return 0;
}
- case KeyType::Binary:
+ case IndexedDB::KeyType::Binary:
return compareBinaryKeyData(WTF::get<ThreadSafeDataBuffer>(m_value), WTF::get<ThreadSafeDataBuffer>(other.m_value));
- case KeyType::String:
+ case IndexedDB::KeyType::String:
return -codePointCompare(WTF::get<String>(other.m_value), WTF::get<String>(m_value));
- case KeyType::Date:
- case KeyType::Number: {
+ case IndexedDB::KeyType::Date:
+ case IndexedDB::KeyType::Number: {
auto number = WTF::get<double>(m_value);
auto otherNumber = WTF::get<double>(other.m_value);
return (number < otherNumber) ? -1 : ((number > otherNumber) ? 1 : 0);
}
- case KeyType::Invalid:
- case KeyType::Min:
- case KeyType::Max:
+ case IndexedDB::KeyType::Invalid:
+ case IndexedDB::KeyType::Min:
+ case IndexedDB::KeyType::Max:
ASSERT_NOT_REACHED();
return 0;
}
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKey.h (236006 => 236007)
--- trunk/Source/WebCore/Modules/indexeddb/IDBKey.h 2018-09-14 15:37:14 UTC (rev 236006)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKey.h 2018-09-14 16:38:19 UTC (rev 236007)
@@ -35,8 +35,6 @@
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
-using WebCore::IndexedDB::KeyType;
-
namespace JSC {
class JSArrayBuffer;
class JSArrayBufferView;
@@ -53,7 +51,7 @@
static Ref<IDBKey> createNumber(double number)
{
- return adoptRef(*new IDBKey(KeyType::Number, number));
+ return adoptRef(*new IDBKey(IndexedDB::KeyType::Number, number));
}
static Ref<IDBKey> createString(const String& string)
@@ -63,7 +61,7 @@
static Ref<IDBKey> createDate(double date)
{
- return adoptRef(*new IDBKey(KeyType::Date, date));
+ return adoptRef(*new IDBKey(IndexedDB::KeyType::Date, date));
}
static Ref<IDBKey> createMultiEntryArray(const Vector<RefPtr<IDBKey>>& array)
@@ -107,36 +105,36 @@
WEBCORE_EXPORT ~IDBKey();
- KeyType type() const { return m_type; }
+ IndexedDB::KeyType type() const { return m_type; }
WEBCORE_EXPORT bool isValid() const;
const Vector<RefPtr<IDBKey>>& array() const
{
- ASSERT(m_type == KeyType::Array);
+ ASSERT(m_type == IndexedDB::KeyType::Array);
return WTF::get<Vector<RefPtr<IDBKey>>>(m_value);
}
const String& string() const
{
- ASSERT(m_type == KeyType::String);
+ ASSERT(m_type == IndexedDB::KeyType::String);
return WTF::get<String>(m_value);
}
double date() const
{
- ASSERT(m_type == KeyType::Date);
+ ASSERT(m_type == IndexedDB::KeyType::Date);
return WTF::get<double>(m_value);
}
double number() const
{
- ASSERT(m_type == KeyType::Number);
+ ASSERT(m_type == IndexedDB::KeyType::Number);
return WTF::get<double>(m_value);
}
const ThreadSafeDataBuffer& binary() const
{
- ASSERT(m_type == KeyType::Binary);
+ ASSERT(m_type == IndexedDB::KeyType::Binary);
return WTF::get<ThreadSafeDataBuffer>(m_value);
}
@@ -146,7 +144,7 @@
size_t sizeEstimate() const { return m_sizeEstimate; }
- static int compareTypes(KeyType a, KeyType b)
+ static int compareTypes(IndexedDB::KeyType a, IndexedDB::KeyType b)
{
return b - a;
}
@@ -160,17 +158,17 @@
private:
IDBKey()
- : m_type(KeyType::Invalid)
+ : m_type(IndexedDB::KeyType::Invalid)
, m_sizeEstimate(OverheadSize)
{
}
- IDBKey(KeyType, double number);
+ IDBKey(IndexedDB::KeyType, double number);
explicit IDBKey(const String& value);
IDBKey(const Vector<RefPtr<IDBKey>>& keyArray, size_t arraySize);
explicit IDBKey(const ThreadSafeDataBuffer&);
- const KeyType m_type;
+ const IndexedDB::KeyType m_type;
Variant<Vector<RefPtr<IDBKey>>, String, double, ThreadSafeDataBuffer> m_value;
const size_t m_sizeEstimate;
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp (236006 => 236007)
--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp 2018-09-14 15:37:14 UTC (rev 236006)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp 2018-09-14 16:38:19 UTC (rev 236007)
@@ -34,7 +34,7 @@
namespace WebCore {
IDBKeyData::IDBKeyData(const IDBKey* key)
- : m_type(KeyType::Invalid)
+ : m_type(IndexedDB::KeyType::Invalid)
{
if (!key) {
m_isNull = true;
@@ -44,9 +44,9 @@
m_type = key->type();
switch (m_type) {
- case KeyType::Invalid:
+ case IndexedDB::KeyType::Invalid:
break;
- case KeyType::Array: {
+ case IndexedDB::KeyType::Array: {
m_value = Vector<IDBKeyData>();
auto& array = WTF::get<Vector<IDBKeyData>>(m_value);
for (auto& key2 : key->array())
@@ -53,20 +53,20 @@
array.append(IDBKeyData(key2.get()));
break;
}
- case KeyType::Binary:
+ case IndexedDB::KeyType::Binary:
m_value = key->binary();
break;
- case KeyType::String:
+ case IndexedDB::KeyType::String:
m_value = key->string();
break;
- case KeyType::Date:
+ case IndexedDB::KeyType::Date:
m_value = key->date();
break;
- case KeyType::Number:
+ case IndexedDB::KeyType::Number:
m_value = key->number();
break;
- case KeyType::Max:
- case KeyType::Min:
+ case IndexedDB::KeyType::Max:
+ case IndexedDB::KeyType::Min:
break;
}
}
@@ -77,9 +77,9 @@
return nullptr;
switch (m_type) {
- case KeyType::Invalid:
+ case IndexedDB::KeyType::Invalid:
return IDBKey::createInvalid();
- case KeyType::Array: {
+ case IndexedDB::KeyType::Array: {
Vector<RefPtr<IDBKey>> array;
for (auto& keyData : WTF::get<Vector<IDBKeyData>>(m_value)) {
array.append(keyData.maybeCreateIDBKey());
@@ -87,16 +87,16 @@
}
return IDBKey::createArray(array);
}
- case KeyType::Binary:
+ case IndexedDB::KeyType::Binary:
return IDBKey::createBinary(WTF::get<ThreadSafeDataBuffer>(m_value));
- case KeyType::String:
+ case IndexedDB::KeyType::String:
return IDBKey::createString(WTF::get<String>(m_value));
- case KeyType::Date:
+ case IndexedDB::KeyType::Date:
return IDBKey::createDate(WTF::get<double>(m_value));
- case KeyType::Number:
+ case IndexedDB::KeyType::Number:
return IDBKey::createNumber(WTF::get<double>(m_value));
- case KeyType::Max:
- case KeyType::Min:
+ case IndexedDB::KeyType::Max:
+ case IndexedDB::KeyType::Min:
ASSERT_NOT_REACHED();
return nullptr;
}
@@ -121,9 +121,9 @@
destination.m_isNull = source.m_isNull;
switch (source.m_type) {
- case KeyType::Invalid:
+ case IndexedDB::KeyType::Invalid:
return;
- case KeyType::Array: {
+ case IndexedDB::KeyType::Array: {
destination.m_value = Vector<IDBKeyData>();
auto& destinationArray = WTF::get<Vector<IDBKeyData>>(destination.m_value);
for (auto& key : WTF::get<Vector<IDBKeyData>>(source.m_value))
@@ -130,18 +130,18 @@
destinationArray.append(key.isolatedCopy());
return;
}
- case KeyType::Binary:
+ case IndexedDB::KeyType::Binary:
destination.m_value = WTF::get<ThreadSafeDataBuffer>(source.m_value);
return;
- case KeyType::String:
+ case IndexedDB::KeyType::String:
destination.m_value = WTF::get<String>(source.m_value).isolatedCopy();
return;
- case KeyType::Date:
- case KeyType::Number:
+ case IndexedDB::KeyType::Date:
+ case IndexedDB::KeyType::Number:
destination.m_value = WTF::get<double>(source.m_value);
return;
- case KeyType::Max:
- case KeyType::Min:
+ case IndexedDB::KeyType::Max:
+ case IndexedDB::KeyType::Min:
return;
}
@@ -157,9 +157,9 @@
encoder.encodeEnum("type", m_type);
switch (m_type) {
- case KeyType::Invalid:
+ case IndexedDB::KeyType::Invalid:
return;
- case KeyType::Array: {
+ case IndexedDB::KeyType::Array: {
auto& array = WTF::get<Vector<IDBKeyData>>(m_value);
encoder.encodeObjects("array", array.begin(), array.end(), [](KeyedEncoder& encoder, const IDBKeyData& key) {
key.encode(encoder);
@@ -166,7 +166,7 @@
});
return;
}
- case KeyType::Binary: {
+ case IndexedDB::KeyType::Binary: {
auto* data = ""
encoder.encodeBool("hasBinary", !!data);
if (data)
@@ -173,15 +173,15 @@
encoder.encodeBytes("binary", data->data(), data->size());
return;
}
- case KeyType::String:
+ case IndexedDB::KeyType::String:
encoder.encodeString("string", WTF::get<String>(m_value));
return;
- case KeyType::Date:
- case KeyType::Number:
+ case IndexedDB::KeyType::Date:
+ case IndexedDB::KeyType::Number:
encoder.encodeDouble("number", WTF::get<double>(m_value));
return;
- case KeyType::Max:
- case KeyType::Min:
+ case IndexedDB::KeyType::Max:
+ case IndexedDB::KeyType::Min:
return;
}
@@ -197,38 +197,38 @@
return true;
auto enumFunction = [](int64_t value) {
- return value == KeyType::Max
- || value == KeyType::Invalid
- || value == KeyType::Array
- || value == KeyType::Binary
- || value == KeyType::String
- || value == KeyType::Date
- || value == KeyType::Number
- || value == KeyType::Min;
+ return value == IndexedDB::KeyType::Max
+ || value == IndexedDB::KeyType::Invalid
+ || value == IndexedDB::KeyType::Array
+ || value == IndexedDB::KeyType::Binary
+ || value == IndexedDB::KeyType::String
+ || value == IndexedDB::KeyType::Date
+ || value == IndexedDB::KeyType::Number
+ || value == IndexedDB::KeyType::Min;
};
if (!decoder.decodeEnum("type", result.m_type, enumFunction))
return false;
- if (result.m_type == KeyType::Invalid)
+ if (result.m_type == IndexedDB::KeyType::Invalid)
return true;
- if (result.m_type == KeyType::Max)
+ if (result.m_type == IndexedDB::KeyType::Max)
return true;
- if (result.m_type == KeyType::Min)
+ if (result.m_type == IndexedDB::KeyType::Min)
return true;
- if (result.m_type == KeyType::String) {
+ if (result.m_type == IndexedDB::KeyType::String) {
result.m_value = String();
return decoder.decodeString("string", WTF::get<String>(result.m_value));
}
- if (result.m_type == KeyType::Number || result.m_type == KeyType::Date) {
+ if (result.m_type == IndexedDB::KeyType::Number || result.m_type == IndexedDB::KeyType::Date) {
result.m_value = 0.0;
return decoder.decodeDouble("number", WTF::get<double>(result.m_value));
}
- if (result.m_type == KeyType::Binary) {
+ if (result.m_type == IndexedDB::KeyType::Binary) {
result.m_value = ThreadSafeDataBuffer();
bool hasBinaryData;
@@ -246,7 +246,7 @@
return true;
}
- ASSERT(result.m_type == KeyType::Array);
+ ASSERT(result.m_type == IndexedDB::KeyType::Array);
auto arrayFunction = [](KeyedDecoder& decoder, IDBKeyData& result) {
return decode(decoder, result);
@@ -258,12 +258,12 @@
int IDBKeyData::compare(const IDBKeyData& other) const
{
- if (m_type == KeyType::Invalid) {
- if (other.m_type != KeyType::Invalid)
+ if (m_type == IndexedDB::KeyType::Invalid) {
+ if (other.m_type != IndexedDB::KeyType::Invalid)
return -1;
- if (other.m_type == KeyType::Invalid)
+ if (other.m_type == IndexedDB::KeyType::Invalid)
return 0;
- } else if (other.m_type == KeyType::Invalid)
+ } else if (other.m_type == IndexedDB::KeyType::Invalid)
return 1;
// The IDBKey::m_type enum is in reverse sort order.
@@ -272,11 +272,11 @@
// The types are the same, so handle actual value comparison.
switch (m_type) {
- case KeyType::Invalid:
+ case IndexedDB::KeyType::Invalid:
// Invalid type should have been fully handled above
ASSERT_NOT_REACHED();
return 0;
- case KeyType::Array: {
+ case IndexedDB::KeyType::Array: {
auto& array = WTF::get<Vector<IDBKeyData>>(m_value);
auto& otherArray = WTF::get<Vector<IDBKeyData>>(other.m_value);
for (size_t i = 0; i < array.size() && i < otherArray.size(); ++i) {
@@ -289,12 +289,12 @@
return 1;
return 0;
}
- case KeyType::Binary:
+ case IndexedDB::KeyType::Binary:
return compareBinaryKeyData(WTF::get<ThreadSafeDataBuffer>(m_value), WTF::get<ThreadSafeDataBuffer>(other.m_value));
- case KeyType::String:
+ case IndexedDB::KeyType::String:
return codePointCompare(WTF::get<String>(m_value), WTF::get<String>(other.m_value));
- case KeyType::Date:
- case KeyType::Number: {
+ case IndexedDB::KeyType::Date:
+ case IndexedDB::KeyType::Number: {
auto number = WTF::get<double>(m_value);
auto otherNumber = WTF::get<double>(other.m_value);
@@ -302,8 +302,8 @@
return 0;
return number > otherNumber ? 1 : -1;
}
- case KeyType::Max:
- case KeyType::Min:
+ case IndexedDB::KeyType::Max:
+ case IndexedDB::KeyType::Min:
return 0;
}
@@ -320,9 +320,9 @@
String result;
switch (m_type) {
- case KeyType::Invalid:
+ case IndexedDB::KeyType::Invalid:
return "<invalid>";
- case KeyType::Array: {
+ case IndexedDB::KeyType::Array: {
StringBuilder builder;
builder.appendLiteral("<array> - { ");
auto& array = WTF::get<Vector<IDBKeyData>>(m_value);
@@ -335,7 +335,7 @@
result = builder.toString();
break;
}
- case KeyType::Binary: {
+ case IndexedDB::KeyType::Binary: {
StringBuilder builder;
builder.append("<binary> - ");
@@ -356,16 +356,16 @@
result = builder.toString();
break;
}
- case KeyType::String:
+ case IndexedDB::KeyType::String:
result = "<string> - " + WTF::get<String>(m_value);
break;
- case KeyType::Date:
+ case IndexedDB::KeyType::Date:
return String::format("<date> - %f", WTF::get<double>(m_value));
- case KeyType::Number:
+ case IndexedDB::KeyType::Number:
return String::format("<number> - %f", WTF::get<double>(m_value));
- case KeyType::Max:
+ case IndexedDB::KeyType::Max:
return "<maximum>";
- case KeyType::Min:
+ case IndexedDB::KeyType::Min:
return "<minimum>";
}
@@ -382,7 +382,7 @@
{
*this = IDBKeyData();
m_value = value;
- m_type = KeyType::Array;
+ m_type = IndexedDB::KeyType::Array;
m_isNull = false;
}
@@ -390,7 +390,7 @@
{
*this = IDBKeyData();
m_value = value;
- m_type = KeyType::Binary;
+ m_type = IndexedDB::KeyType::Binary;
m_isNull = false;
}
@@ -398,7 +398,7 @@
{
*this = IDBKeyData();
m_value = value;
- m_type = KeyType::String;
+ m_type = IndexedDB::KeyType::String;
m_isNull = false;
}
@@ -406,7 +406,7 @@
{
*this = IDBKeyData();
m_value = value;
- m_type = KeyType::Date;
+ m_type = IndexedDB::KeyType::Date;
m_isNull = false;
}
@@ -414,7 +414,7 @@
{
*this = IDBKeyData();
m_value = value;
- m_type = KeyType::Number;
+ m_type = IndexedDB::KeyType::Number;
m_isNull = false;
}
@@ -428,10 +428,10 @@
bool IDBKeyData::isValid() const
{
- if (m_type == KeyType::Invalid)
+ if (m_type == IndexedDB::KeyType::Invalid)
return false;
- if (m_type == KeyType::Array) {
+ if (m_type == IndexedDB::KeyType::Array) {
for (auto& key : array()) {
if (!key.isValid())
return false;
@@ -451,18 +451,18 @@
if (m_type != other.m_type || m_isNull != other.m_isNull || m_isDeletedValue != other.m_isDeletedValue)
return false;
switch (m_type) {
- case KeyType::Invalid:
- case KeyType::Max:
- case KeyType::Min:
+ case IndexedDB::KeyType::Invalid:
+ case IndexedDB::KeyType::Max:
+ case IndexedDB::KeyType::Min:
return true;
- case KeyType::Number:
- case KeyType::Date:
+ case IndexedDB::KeyType::Number:
+ case IndexedDB::KeyType::Date:
return WTF::get<double>(m_value) == WTF::get<double>(other.m_value);
- case KeyType::String:
+ case IndexedDB::KeyType::String:
return WTF::get<String>(m_value) == WTF::get<String>(other.m_value);
- case KeyType::Binary:
+ case IndexedDB::KeyType::Binary:
return WTF::get<ThreadSafeDataBuffer>(m_value) == WTF::get<ThreadSafeDataBuffer>(other.m_value);
- case KeyType::Array:
+ case IndexedDB::KeyType::Array:
return WTF::get<Vector<IDBKeyData>>(m_value) == WTF::get<Vector<IDBKeyData>>(other.m_value);
}
RELEASE_ASSERT_NOT_REACHED();
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h (236006 => 236007)
--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h 2018-09-14 15:37:14 UTC (rev 236006)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h 2018-09-14 16:38:19 UTC (rev 236007)
@@ -40,7 +40,7 @@
class IDBKeyData {
public:
IDBKeyData()
- : m_type(KeyType::Invalid)
+ : m_type(IndexedDB::KeyType::Invalid)
, m_isNull(true)
{
}
@@ -53,7 +53,7 @@
static IDBKeyData minimum()
{
IDBKeyData result;
- result.m_type = KeyType::Min;
+ result.m_type = IndexedDB::KeyType::Min;
result.m_isNull = false;
return result;
}
@@ -61,7 +61,7 @@
static IDBKeyData maximum()
{
IDBKeyData result;
- result.m_type = KeyType::Max;
+ result.m_type = IndexedDB::KeyType::Max;
result.m_isNull = false;
return result;
}
@@ -94,7 +94,7 @@
bool isNull() const { return m_isNull; }
bool isValid() const;
- KeyType type() const { return m_type; }
+ IndexedDB::KeyType type() const { return m_type; }
bool operator<(const IDBKeyData&) const;
bool operator>(const IDBKeyData& other) const
@@ -125,18 +125,18 @@
hashCodes.append(m_isNull ? 1 : 0);
hashCodes.append(m_isDeletedValue ? 1 : 0);
switch (m_type) {
- case KeyType::Invalid:
- case KeyType::Max:
- case KeyType::Min:
+ case IndexedDB::KeyType::Invalid:
+ case IndexedDB::KeyType::Max:
+ case IndexedDB::KeyType::Min:
break;
- case KeyType::Number:
- case KeyType::Date:
+ case IndexedDB::KeyType::Number:
+ case IndexedDB::KeyType::Date:
hashCodes.append(StringHasher::hashMemory<sizeof(double)>(&WTF::get<double>(m_value)));
break;
- case KeyType::String:
+ case IndexedDB::KeyType::String:
hashCodes.append(StringHash::hash(WTF::get<String>(m_value)));
break;
- case KeyType::Binary: {
+ case IndexedDB::KeyType::Binary: {
auto* data = ""
if (!data)
hashCodes.append(0);
@@ -144,7 +144,7 @@
hashCodes.append(StringHasher::hashMemory(data->data(), data->size()));
break;
}
- case KeyType::Array:
+ case IndexedDB::KeyType::Array:
for (auto& key : WTF::get<Vector<IDBKeyData>>(m_value))
hashCodes.append(key.hash());
break;
@@ -158,31 +158,31 @@
String string() const
{
- ASSERT(m_type == KeyType::String);
+ ASSERT(m_type == IndexedDB::KeyType::String);
return WTF::get<String>(m_value);
}
double date() const
{
- ASSERT(m_type == KeyType::Date);
+ ASSERT(m_type == IndexedDB::KeyType::Date);
return WTF::get<double>(m_value);
}
double number() const
{
- ASSERT(m_type == KeyType::Number);
+ ASSERT(m_type == IndexedDB::KeyType::Number);
return WTF::get<double>(m_value);
}
const ThreadSafeDataBuffer& binary() const
{
- ASSERT(m_type == KeyType::Binary);
+ ASSERT(m_type == IndexedDB::KeyType::Binary);
return WTF::get<ThreadSafeDataBuffer>(m_value);
}
const Vector<IDBKeyData>& array() const
{
- ASSERT(m_type == KeyType::Array);
+ ASSERT(m_type == IndexedDB::KeyType::Array);
return WTF::get<Vector<IDBKeyData>>(m_value);
}
@@ -189,7 +189,7 @@
private:
static void isolatedCopy(const IDBKeyData& source, IDBKeyData& destination);
- KeyType m_type;
+ IndexedDB::KeyType m_type;
Variant<Vector<IDBKeyData>, String, double, ThreadSafeDataBuffer> m_value;
bool m_isNull { false };
@@ -238,21 +238,21 @@
encoder.encodeEnum(m_type);
switch (m_type) {
- case KeyType::Invalid:
- case KeyType::Max:
- case KeyType::Min:
+ case IndexedDB::KeyType::Invalid:
+ case IndexedDB::KeyType::Max:
+ case IndexedDB::KeyType::Min:
break;
- case KeyType::Array:
+ case IndexedDB::KeyType::Array:
encoder << WTF::get<Vector<IDBKeyData>>(m_value);
break;
- case KeyType::Binary:
+ case IndexedDB::KeyType::Binary:
encoder << WTF::get<ThreadSafeDataBuffer>(m_value);
break;
- case KeyType::String:
+ case IndexedDB::KeyType::String:
encoder << WTF::get<String>(m_value);
break;
- case KeyType::Date:
- case KeyType::Number:
+ case IndexedDB::KeyType::Date:
+ case IndexedDB::KeyType::Number:
encoder << WTF::get<double>(m_value);
break;
}
@@ -272,27 +272,27 @@
return std::nullopt;
switch (keyData.m_type) {
- case KeyType::Invalid:
- case KeyType::Max:
- case KeyType::Min:
+ case IndexedDB::KeyType::Invalid:
+ case IndexedDB::KeyType::Max:
+ case IndexedDB::KeyType::Min:
break;
- case KeyType::Array:
+ case IndexedDB::KeyType::Array:
keyData.m_value = Vector<IDBKeyData>();
if (!decoder.decode(WTF::get<Vector<IDBKeyData>>(keyData.m_value)))
return std::nullopt;
break;
- case KeyType::Binary:
+ case IndexedDB::KeyType::Binary:
keyData.m_value = ThreadSafeDataBuffer();
if (!decoder.decode(WTF::get<ThreadSafeDataBuffer>(keyData.m_value)))
return std::nullopt;
break;
- case KeyType::String:
+ case IndexedDB::KeyType::String:
keyData.m_value = String();
if (!decoder.decode(WTF::get<String>(keyData.m_value)))
return std::nullopt;
break;
- case KeyType::Date:
- case KeyType::Number:
+ case IndexedDB::KeyType::Date:
+ case IndexedDB::KeyType::Number:
keyData.m_value = 0.0;
if (!decoder.decode(WTF::get<double>(keyData.m_value)))
return std::nullopt;
Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp (236006 => 236007)
--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp 2018-09-14 15:37:14 UTC (rev 236006)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp 2018-09-14 16:38:19 UTC (rev 236007)
@@ -2219,7 +2219,7 @@
{
LOG(IndexedDB, "SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey");
- ASSERT(key.isValid() && key.type() != KeyType::Max && key.type() != KeyType::Min);
+ ASSERT(key.isValid() && key.type() != IndexedDB::KeyType::Max && key.type() != IndexedDB::KeyType::Min);
RefPtr<SharedBuffer> buffer = serializeIDBKeyData(key);
if (!buffer) {
Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (236006 => 236007)
--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp 2018-09-14 15:37:14 UTC (rev 236006)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp 2018-09-14 16:38:19 UTC (rev 236007)
@@ -96,7 +96,7 @@
auto scope = DECLARE_THROW_SCOPE(vm);
switch (key->type()) {
- case KeyType::Array: {
+ case IndexedDB::KeyType::Array: {
auto& inArray = key->array();
unsigned size = inArray.size();
auto outArray = constructEmptyArray(&state, 0, &globalObject, size);
@@ -107,7 +107,7 @@
}
return outArray;
}
- case KeyType::Binary: {
+ case IndexedDB::KeyType::Binary: {
auto* data = ""
if (!data) {
ASSERT_NOT_REACHED();
@@ -121,17 +121,17 @@
return JSArrayBuffer::create(state.vm(), structure, WTFMove(arrayBuffer));
}
- case KeyType::String:
+ case IndexedDB::KeyType::String:
return jsStringWithCache(&state, key->string());
- case KeyType::Date:
+ case IndexedDB::KeyType::Date:
// FIXME: This should probably be toJS<IDLDate>(...) as per:
// http://w3c.github.io/IndexedDB/#request-convert-a-key-to-a-value
return toJS<IDLNullable<IDLDate>>(state, key->date());
- case KeyType::Number:
+ case IndexedDB::KeyType::Number:
return jsNumber(key->number());
- case KeyType::Min:
- case KeyType::Max:
- case KeyType::Invalid:
+ case IndexedDB::KeyType::Min:
+ case IndexedDB::KeyType::Max:
+ case IndexedDB::KeyType::Invalid:
ASSERT_NOT_REACHED();
return jsUndefined();
}