Title: [191620] trunk/Source
Revision
191620
Author
beid...@apple.com
Date
2015-10-26 22:22:55 -0700 (Mon, 26 Oct 2015)

Log Message

Make IDBKeyData from a struct to a class.
https://bugs.webkit.org/show_bug.cgi?id=150576

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No change in behavior).

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::maybeCreateIDBKey):
(WebCore::IDBKeyData::isolatedCopy):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
(WebCore::IDBKeyData::compare):
(WebCore::IDBKeyData::loggingString):
(WebCore::IDBKeyData::setArrayValue):
(WebCore::IDBKeyData::setStringValue):
(WebCore::IDBKeyData::setDateValue):
(WebCore::IDBKeyData::setNumberValue):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::minimum):
(WebCore::IDBKeyData::maximum):
(WebCore::IDBKeyData::isNull):
(WebCore::IDBKeyData::type):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
(WebCore::GetOperation::perform):
* bindings/js/IDBBindingUtilities.h:
* platform/CrossThreadCopier.h:

Source/WebKit2:

* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
* DatabaseProcess/IndexedDB/IDBSerialization.h:
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::putRecordInBackingStore):
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
(WebKit::buildIndexStatement):
(WebKit::buildObjectStoreStatement):
(WebKit::SQLiteIDBCursor::establishStatement):
(WebKit::SQLiteIDBCursor::createSQLiteStatement):
(WebKit::SQLiteIDBCursor::resetAndRebindStatement):
(WebKit::SQLiteIDBCursor::iterate):
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::didPutRecord):
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (191619 => 191620)


--- trunk/Source/WebCore/ChangeLog	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebCore/ChangeLog	2015-10-27 05:22:55 UTC (rev 191620)
@@ -1,3 +1,37 @@
+2015-10-26  Brady Eidson  <beid...@apple.com>
+
+        Make IDBKeyData from a struct to a class.
+        https://bugs.webkit.org/show_bug.cgi?id=150576
+
+        Reviewed by Alex Christensen.
+
+        No new tests (No change in behavior).
+
+        * Modules/indexeddb/IDBKeyData.cpp:
+        (WebCore::IDBKeyData::IDBKeyData):
+        (WebCore::IDBKeyData::maybeCreateIDBKey):
+        (WebCore::IDBKeyData::isolatedCopy):
+        (WebCore::IDBKeyData::encode):
+        (WebCore::IDBKeyData::decode):
+        (WebCore::IDBKeyData::compare):
+        (WebCore::IDBKeyData::loggingString):
+        (WebCore::IDBKeyData::setArrayValue):
+        (WebCore::IDBKeyData::setStringValue):
+        (WebCore::IDBKeyData::setDateValue):
+        (WebCore::IDBKeyData::setNumberValue):
+        * Modules/indexeddb/IDBKeyData.h:
+        (WebCore::IDBKeyData::IDBKeyData):
+        (WebCore::IDBKeyData::minimum):
+        (WebCore::IDBKeyData::maximum):
+        (WebCore::IDBKeyData::isNull):
+        (WebCore::IDBKeyData::type):
+        (WebCore::IDBKeyData::encode):
+        (WebCore::IDBKeyData::decode):
+        * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp:
+        (WebCore::GetOperation::perform):
+        * bindings/js/IDBBindingUtilities.h:
+        * platform/CrossThreadCopier.h:
+
 2015-10-26  Philip Chimento  <philip.chime...@gmail.com>
 
         [GTK] [Stable] Build GL texture mapper only if USE_TEXTURE_MAPPER_GL

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp (191619 => 191620)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp	2015-10-27 05:22:55 UTC (rev 191620)
@@ -34,33 +34,30 @@
 namespace WebCore {
 
 IDBKeyData::IDBKeyData(const IDBKey* key)
-    : type(KeyType::Invalid)
-    , numberValue(0)
-    , isNull(false)
+    : m_type(KeyType::Invalid)
 {
     if (!key) {
-        isNull = true;
+        m_isNull = true;
         return;
     }
 
-    type = key->type();
-    numberValue = 0;
+    m_type = key->type();
 
-    switch (type) {
+    switch (m_type) {
     case KeyType::Invalid:
         break;
     case KeyType::Array:
         for (auto& key2 : key->array())
-            arrayValue.append(IDBKeyData(key2.get()));
+            m_arrayValue.append(IDBKeyData(key2.get()));
         break;
     case KeyType::String:
-        stringValue = key->string();
+        m_stringValue = key->string();
         break;
     case KeyType::Date:
-        numberValue = key->date();
+        m_numberValue = key->date();
         break;
     case KeyType::Number:
-        numberValue = key->number();
+        m_numberValue = key->number();
         break;
     case KeyType::Max:
     case KeyType::Min:
@@ -70,27 +67,27 @@
 
 PassRefPtr<IDBKey> IDBKeyData::maybeCreateIDBKey() const
 {
-    if (isNull)
+    if (m_isNull)
         return nullptr;
 
-    switch (type) {
+    switch (m_type) {
     case KeyType::Invalid:
         return IDBKey::createInvalid();
     case KeyType::Array:
         {
             Vector<RefPtr<IDBKey>> array;
-            for (auto& keyData : arrayValue) {
+            for (auto& keyData : m_arrayValue) {
                 array.append(keyData.maybeCreateIDBKey());
                 ASSERT(array.last());
             }
             return IDBKey::createArray(array);
         }
     case KeyType::String:
-        return IDBKey::createString(stringValue);
+        return IDBKey::createString(m_stringValue);
     case KeyType::Date:
-        return IDBKey::createDate(numberValue);
+        return IDBKey::createDate(m_numberValue);
     case KeyType::Number:
-        return IDBKey::createNumber(numberValue);
+        return IDBKey::createNumber(m_numberValue);
     case KeyType::Max:
     case KeyType::Min:
         ASSERT_NOT_REACHED();
@@ -104,22 +101,22 @@
 IDBKeyData IDBKeyData::isolatedCopy() const
 {
     IDBKeyData result;
-    result.type = type;
-    result.isNull = isNull;
+    result.m_type = m_type;
+    result.m_isNull = m_isNull;
 
-    switch (type) {
+    switch (m_type) {
     case KeyType::Invalid:
         return result;
     case KeyType::Array:
-        for (auto& key : arrayValue)
-            result.arrayValue.append(key.isolatedCopy());
+        for (auto& key : m_arrayValue)
+            result.m_arrayValue.append(key.isolatedCopy());
         return result;
     case KeyType::String:
-        result.stringValue = stringValue.isolatedCopy();
+        result.m_stringValue = m_stringValue.isolatedCopy();
         return result;
     case KeyType::Date:
     case KeyType::Number:
-        result.numberValue = numberValue;
+        result.m_numberValue = m_numberValue;
         return result;
     case KeyType::Max:
     case KeyType::Min:
@@ -132,26 +129,26 @@
 
 void IDBKeyData::encode(KeyedEncoder& encoder) const
 {
-    encoder.encodeBool("null", isNull);
-    if (isNull)
+    encoder.encodeBool("null", m_isNull);
+    if (m_isNull)
         return;
 
-    encoder.encodeEnum("type", type);
+    encoder.encodeEnum("m_type", m_type);
 
-    switch (type) {
+    switch (m_type) {
     case KeyType::Invalid:
         return;
     case KeyType::Array:
-        encoder.encodeObjects("array", arrayValue.begin(), arrayValue.end(), [](KeyedEncoder& encoder, const IDBKeyData& key) {
+        encoder.encodeObjects("array", m_arrayValue.begin(), m_arrayValue.end(), [](KeyedEncoder& encoder, const IDBKeyData& key) {
             key.encode(encoder);
         });
         return;
     case KeyType::String:
-        encoder.encodeString("string", stringValue);
+        encoder.encodeString("string", m_stringValue);
         return;
     case KeyType::Date:
     case KeyType::Number:
-        encoder.encodeDouble("number", numberValue);
+        encoder.encodeDouble("number", m_numberValue);
         return;
     case KeyType::Max:
     case KeyType::Min:
@@ -163,10 +160,10 @@
 
 bool IDBKeyData::decode(KeyedDecoder& decoder, IDBKeyData& result)
 {
-    if (!decoder.decodeBool("null", result.isNull))
+    if (!decoder.decodeBool("null", result.m_isNull))
         return false;
 
-    if (result.isNull)
+    if (result.m_isNull)
         return true;
 
     auto enumFunction = [](int64_t value) {
@@ -178,71 +175,71 @@
             || value == KeyType::Number
             || value == KeyType::Min;
     };
-    if (!decoder.decodeEnum("type", result.type, enumFunction))
+    if (!decoder.decodeEnum("m_type", result.m_type, enumFunction))
         return false;
 
-    if (result.type == KeyType::Invalid)
+    if (result.m_type == KeyType::Invalid)
         return true;
 
-    if (result.type == KeyType::Max)
+    if (result.m_type == KeyType::Max)
         return true;
 
-    if (result.type == KeyType::Min)
+    if (result.m_type == KeyType::Min)
         return true;
 
-    if (result.type == KeyType::String)
-        return decoder.decodeString("string", result.stringValue);
+    if (result.m_type == KeyType::String)
+        return decoder.decodeString("string", result.m_stringValue);
 
-    if (result.type == KeyType::Number || result.type == KeyType::Date)
-        return decoder.decodeDouble("number", result.numberValue);
+    if (result.m_type == KeyType::Number || result.m_type == KeyType::Date)
+        return decoder.decodeDouble("number", result.m_numberValue);
 
-    ASSERT(result.type == KeyType::Array);
+    ASSERT(result.m_type == KeyType::Array);
 
     auto arrayFunction = [](KeyedDecoder& decoder, IDBKeyData& result) {
         return decode(decoder, result);
     };
     
-    result.arrayValue.clear();
-    return decoder.decodeObjects("array", result.arrayValue, arrayFunction);
+    result.m_arrayValue.clear();
+    return decoder.decodeObjects("array", result.m_arrayValue, arrayFunction);
 }
 
 int IDBKeyData::compare(const IDBKeyData& other) const
 {
-    if (type == KeyType::Invalid) {
-        if (other.type != KeyType::Invalid)
+    if (m_type == KeyType::Invalid) {
+        if (other.m_type != KeyType::Invalid)
             return -1;
-        if (other.type == KeyType::Invalid)
+        if (other.m_type == KeyType::Invalid)
             return 0;
-    } else if (other.type == KeyType::Invalid)
+    } else if (other.m_type == KeyType::Invalid)
         return 1;
 
-    // The IDBKey::Type enum is in reverse sort order.
-    if (type != other.type)
-        return type < other.type ? 1 : -1;
+    // The IDBKey::m_type enum is in reverse sort order.
+    if (m_type != other.m_type)
+        return m_type < other.m_type ? 1 : -1;
 
     // The types are the same, so handle actual value comparison.
-    switch (type) {
+    switch (m_type) {
     case KeyType::Invalid:
-        // InvalidType should have been fully handled above
+        // Invalid type should have been fully handled above
         ASSERT_NOT_REACHED();
         return 0;
     case KeyType::Array:
-        for (size_t i = 0; i < arrayValue.size() && i < other.arrayValue.size(); ++i) {
-            if (int result = arrayValue[i].compare(other.arrayValue[i]))
+        for (size_t i = 0; i < m_arrayValue.size() && i < other.m_arrayValue.size(); ++i) {
+            if (int result = m_arrayValue[i].compare(other.m_arrayValue[i]))
                 return result;
         }
-        if (arrayValue.size() < other.arrayValue.size())
+        if (m_arrayValue.size() < other.m_arrayValue.size())
             return -1;
-        if (arrayValue.size() > other.arrayValue.size())
+        if (m_arrayValue.size() > other.m_arrayValue.size())
             return 1;
         return 0;
     case KeyType::String:
-        return codePointCompare(stringValue, other.stringValue);
+        return codePointCompare(m_stringValue, other.m_stringValue);
     case KeyType::Date:
     case KeyType::Number:
-        if (numberValue == other.numberValue)
+        if (m_numberValue == other.m_numberValue)
             return 0;
-        return numberValue > other.numberValue ? 1 : -1;
+        return m_numberValue > other.m_numberValue ? 1 : -1;
     case KeyType::Max:
     case KeyType::Min:
         return 0;
@@ -255,30 +252,30 @@
 #ifndef NDEBUG
 String IDBKeyData::loggingString() const
 {
-    if (isNull)
+    if (m_isNull)
         return "<null>";
 
-    switch (type) {
+    switch (m_type) {
     case KeyType::Invalid:
         return "<invalid>";
     case KeyType::Array:
         {
             StringBuilder result;
             result.appendLiteral("<array> - { ");
-            for (size_t i = 0; i < arrayValue.size(); ++i) {
-                result.append(arrayValue[i].loggingString());
-                if (i < arrayValue.size() - 1)
+            for (size_t i = 0; i < m_arrayValue.size(); ++i) {
+                result.append(m_arrayValue[i].loggingString());
+                if (i < m_arrayValue.size() - 1)
                     result.appendLiteral(", ");
             }
             result.appendLiteral(" }");
             return result.toString();
         }
     case KeyType::String:
-        return "<string> - " + stringValue;
+        return "<string> - " + m_stringValue;
     case KeyType::Date:
-        return String::format("Date type - %f", numberValue);
+        return String::format("Date m_type - %f", m_numberValue);
     case KeyType::Number:
-        return String::format("<number> - %f", numberValue);
+        return String::format("<number> - %f", m_numberValue);
     case KeyType::Max:
         return "<maximum>";
     case KeyType::Min:
@@ -293,33 +290,33 @@
 void IDBKeyData::setArrayValue(const Vector<IDBKeyData>& value)
 {
     *this = IDBKeyData();
-    arrayValue = value;
-    type = KeyType::Array;
-    isNull = false;
+    m_arrayValue = value;
+    m_type = KeyType::Array;
+    m_isNull = false;
 }
 
 void IDBKeyData::setStringValue(const String& value)
 {
     *this = IDBKeyData();
-    stringValue = value;
-    type = KeyType::String;
-    isNull = false;
+    m_stringValue = value;
+    m_type = KeyType::String;
+    m_isNull = false;
 }
 
 void IDBKeyData::setDateValue(double value)
 {
     *this = IDBKeyData();
-    numberValue = value;
-    type = KeyType::Date;
-    isNull = false;
+    m_numberValue = value;
+    m_type = KeyType::Date;
+    m_isNull = false;
 }
 
 void IDBKeyData::setNumberValue(double value)
 {
     *this = IDBKeyData();
-    numberValue = value;
-    type = KeyType::Number;
-    isNull = false;
+    m_numberValue = value;
+    m_type = KeyType::Number;
+    m_isNull = false;
 }
 
 }

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h (191619 => 191620)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h	2015-10-27 05:22:55 UTC (rev 191620)
@@ -35,11 +35,11 @@
 class KeyedDecoder;
 class KeyedEncoder;
 
-struct IDBKeyData {
+class IDBKeyData {
+public:
     IDBKeyData()
-        : type(KeyType::Invalid)
-        , numberValue(0)
-        , isNull(true)
+        : m_type(KeyType::Invalid)
+        , m_isNull(true)
     {
     }
 
@@ -48,16 +48,16 @@
     static IDBKeyData minimum()
     {
         IDBKeyData result;
-        result.type = KeyType::Min;
-        result.isNull = false;
+        result.m_type = KeyType::Min;
+        result.m_isNull = false;
         return result;
     }
 
     static IDBKeyData maximum()
     {
         IDBKeyData result;
-        result.type = KeyType::Max;
-        result.isNull = false;
+        result.m_type = KeyType::Max;
+        result.m_isNull = false;
         return result;
     }
 
@@ -86,34 +86,38 @@
     WEBCORE_EXPORT String loggingString() const;
 #endif
 
-    KeyType type;
-    Vector<IDBKeyData> arrayValue;
-    String stringValue;
-    double numberValue;
-    bool isNull;
+    bool isNull() const { return m_isNull; }
+    KeyType type() const { return m_type; }
+
+private:
+    KeyType m_type;
+    Vector<IDBKeyData> m_arrayValue;
+    String m_stringValue;
+    double m_numberValue { 0 };
+    bool m_isNull { false };
 };
 
 template<class Encoder>
 void IDBKeyData::encode(Encoder& encoder) const
 {
-    encoder << isNull;
-    if (isNull)
+    encoder << m_isNull;
+    if (m_isNull)
         return;
 
-    encoder.encodeEnum(type);
+    encoder.encodeEnum(m_type);
 
-    switch (type) {
+    switch (m_type) {
     case KeyType::Invalid:
         break;
     case KeyType::Array:
-        encoder << arrayValue;
+        encoder << m_arrayValue;
         break;
     case KeyType::String:
-        encoder << stringValue;
+        encoder << m_stringValue;
         break;
     case KeyType::Date:
     case KeyType::Number:
-        encoder << numberValue;
+        encoder << m_numberValue;
         break;
     case KeyType::Max:
     case KeyType::Min:
@@ -127,29 +131,29 @@
 template<class Decoder>
 bool IDBKeyData::decode(Decoder& decoder, IDBKeyData& keyData)
 {
-    if (!decoder.decode(keyData.isNull))
+    if (!decoder.decode(keyData.m_isNull))
         return false;
 
-    if (keyData.isNull)
+    if (keyData.m_isNull)
         return true;
 
-    if (!decoder.decodeEnum(keyData.type))
+    if (!decoder.decodeEnum(keyData.m_type))
         return false;
 
-    switch (keyData.type) {
+    switch (keyData.m_type) {
     case KeyType::Invalid:
         break;
     case KeyType::Array:
-        if (!decoder.decode(keyData.arrayValue))
+        if (!decoder.decode(keyData.m_arrayValue))
             return false;
         break;
     case KeyType::String:
-        if (!decoder.decode(keyData.stringValue))
+        if (!decoder.decode(keyData.m_stringValue))
             return false;
         break;
     case KeyType::Date:
     case KeyType::Number:
-        if (!decoder.decode(keyData.numberValue))
+        if (!decoder.decode(keyData.m_numberValue))
             return false;
         break;
     case KeyType::Max:

Modified: trunk/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp (191619 => 191620)


--- trunk/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebCore/Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp	2015-10-27 05:22:55 UTC (rev 191620)
@@ -101,12 +101,12 @@
             m_callbacks->onError(error);
         else {
             if (!result.valueBuffer) {
-                if (result.keyData.isNull)
+                if (result.keyData.isNull())
                     m_callbacks->onSuccess();
                 else
                     m_callbacks->onSuccess(result.keyData.maybeCreateIDBKey());
             } else {
-                if (!result.keyData.isNull)
+                if (!result.keyData.isNull())
                     m_callbacks->onSuccess(result.valueBuffer, result.keyData.maybeCreateIDBKey(), result.keyPath);
                 else
                     m_callbacks->onSuccess(result.valueBuffer.get());

Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h (191619 => 191620)


--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.h	2015-10-27 05:22:55 UTC (rev 191620)
@@ -40,7 +40,7 @@
 class SharedBuffer;
 
 struct IDBIndexMetadata;
-struct IDBKeyData;
+class IDBKeyData;
 
 IDBKeyPath idbKeyPathFromValue(JSC::ExecState*, JSC::JSValue);
 

Modified: trunk/Source/WebCore/platform/CrossThreadCopier.h (191619 => 191620)


--- trunk/Source/WebCore/platform/CrossThreadCopier.h	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.h	2015-10-27 05:22:55 UTC (rev 191620)
@@ -173,7 +173,7 @@
         static Type copy(const IDBIndexMetadata&);
     };
 
-    struct IDBKeyData;
+    class IDBKeyData;
     template<> struct WEBCORE_EXPORT CrossThreadCopierBase<false, false, IDBKeyData> {
         typedef IDBKeyData Type;
         static Type copy(const IDBKeyData&);

Modified: trunk/Source/WebKit2/ChangeLog (191619 => 191620)


--- trunk/Source/WebKit2/ChangeLog	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/ChangeLog	2015-10-27 05:22:55 UTC (rev 191620)
@@ -1,3 +1,31 @@
+2015-10-26  Brady Eidson  <beid...@apple.com>
+
+        Make IDBKeyData from a struct to a class.
+        https://bugs.webkit.org/show_bug.cgi?id=150576
+
+        Reviewed by Alex Christensen.
+
+        * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
+        * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
+        * DatabaseProcess/IndexedDB/IDBSerialization.h:
+        * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
+        (WebKit::UniqueIDBDatabase::putRecordInBackingStore):
+        * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
+        * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
+        * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
+        (WebKit::buildIndexStatement):
+        (WebKit::buildObjectStoreStatement):
+        (WebKit::SQLiteIDBCursor::establishStatement):
+        (WebKit::SQLiteIDBCursor::createSQLiteStatement):
+        (WebKit::SQLiteIDBCursor::resetAndRebindStatement):
+        (WebKit::SQLiteIDBCursor::iterate):
+        * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
+        (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
+        (WebKit::WebIDBServerConnection::didPutRecord):
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
+        * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in:
+
 2015-10-26  Philip Chimento  <philip.chime...@gmail.com>
 
         [GTK] [Stable] InstallMissingMediaPluginsPermissionRequest not defined when building without GStreamer

Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h (191619 => 191620)


--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h	2015-10-27 05:22:55 UTC (rev 191620)
@@ -36,7 +36,7 @@
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
-struct IDBKeyData;
+class IDBKeyData;
 struct IDBKeyRangeData;
 }
 

Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in (191619 => 191620)


--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in	2015-10-27 05:22:55 UTC (rev 191620)
@@ -43,12 +43,12 @@
     CreateIndex(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, struct WebCore::IDBIndexMetadata indexMetadata)
     DeleteIndex(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, int64_t indexID)
 
-    PutRecord(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, struct WebCore::IDBKeyData key, IPC::DataReference value, int64_t putMode, Vector<int64_t> indexIDs, Vector<Vector<WebCore::IDBKeyData>> indexKeys)
+    PutRecord(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, WebCore::IDBKeyData key, IPC::DataReference value, int64_t putMode, Vector<int64_t> indexIDs, Vector<Vector<WebCore::IDBKeyData>> indexKeys)
     GetRecord(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, int64_t indexID, struct WebCore::IDBKeyRangeData keyRange, int64_t cursorType)
     
     OpenCursor(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, int64_t indexID, int64_t cursorDirection, int64_t cursorType, int64_t taskType, struct WebCore::IDBKeyRangeData keyRange)
     CursorAdvance(uint64_t requestID, int64_t cursorID, uint64_t count)
-    CursorIterate(uint64_t requestID, int64_t cursorID, struct WebCore::IDBKeyData key)
+    CursorIterate(uint64_t requestID, int64_t cursorID, WebCore::IDBKeyData key)
     
     Count(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, int64_t indexID, struct WebCore::IDBKeyRangeData keyRange)
     DeleteRange(uint64_t requestID, int64_t transactionID, int64_t objectStoreID, struct WebCore::IDBKeyRangeData keyRange)

Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.h (191619 => 191620)


--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.h	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.h	2015-10-27 05:22:55 UTC (rev 191620)
@@ -32,9 +32,8 @@
 #include <wtf/Vector.h>
 
 namespace WebCore {
+class IDBKeyData;
 class IDBKeyPath;
-
-struct IDBKeyData;
 }
 
 namespace WebKit {

Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp (191619 => 191620)


--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp	2015-10-27 05:22:55 UTC (rev 191620)
@@ -829,7 +829,7 @@
     IDBKeyData key;
     int64_t keyNumber = 0;
 
-    if (putMode != IDBDatabaseBackend::CursorUpdate && objectStoreMetadata.autoIncrement && inputKeyData.isNull) {
+    if (putMode != IDBDatabaseBackend::CursorUpdate && objectStoreMetadata.autoIncrement && inputKeyData.isNull()) {
         if (!m_backingStore->generateKeyNumber(transaction, objectStoreMetadata.id, keyNumber)) {
             postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error checking for key existence")));
             return;
@@ -875,7 +875,7 @@
 
     m_backingStore->notifyCursorsOfChanges(transaction, objectStoreMetadata.id);
 
-    if (putMode != IDBDatabaseBackend::CursorUpdate && objectStoreMetadata.autoIncrement && key.type == KeyType::Number) {
+    if (putMode != IDBDatabaseBackend::CursorUpdate && objectStoreMetadata.autoIncrement && key.type() == KeyType::Number) {
         if (!m_backingStore->updateKeyGeneratorNumber(transaction, objectStoreMetadata.id, keyNumber, keyWasGenerated)) {
             postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error updating key generator")));
             return;

Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h (191619 => 191620)


--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h	2015-10-27 05:22:55 UTC (rev 191620)
@@ -46,11 +46,11 @@
 
 namespace WebCore {
 class CrossThreadTask;
+class IDBKeyData;
 class SharedBuffer;
 
 struct IDBDatabaseMetadata;
 struct IDBGetResult;
-struct IDBKeyData;
 struct IDBKeyRangeData;
 struct SecurityOriginData;
 }

Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h (191619 => 191620)


--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h	2015-10-27 05:22:55 UTC (rev 191620)
@@ -33,12 +33,12 @@
 
 namespace WebCore {
 class IDBKey;
+class IDBKeyData;
 class IDBKeyRange;
 class SharedBuffer;
 
 struct IDBDatabaseMetadata;
 struct IDBGetResult;
-struct IDBKeyData;
 struct IDBObjectStoreMetadata;
 }
 

Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp (191619 => 191620)


--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp	2015-10-27 05:22:55 UTC (rev 191620)
@@ -72,13 +72,13 @@
     StringBuilder builder;
 
     builder.appendLiteral("SELECT rowid, key, value FROM IndexRecords WHERE indexID = ? AND key ");
-    if (!keyRange.lowerKey.isNull && !keyRange.lowerOpen)
+    if (!keyRange.lowerKey.isNull() && !keyRange.lowerOpen)
         builder.appendLiteral(">=");
     else
         builder.append('>');
 
     builder.appendLiteral(" CAST(? AS TEXT) AND key ");
-    if (!keyRange.upperKey.isNull && !keyRange.upperOpen)
+    if (!keyRange.upperKey.isNull() && !keyRange.upperOpen)
         builder.appendLiteral("<=");
     else
         builder.append('<');
@@ -102,14 +102,14 @@
 
     builder.appendLiteral("SELECT rowid, key, value FROM Records WHERE objectStoreID = ? AND key ");
 
-    if (!keyRange.lowerKey.isNull && !keyRange.lowerOpen)
+    if (!keyRange.lowerKey.isNull() && !keyRange.lowerOpen)
         builder.appendLiteral(">=");
     else
         builder.append('>');
 
     builder.appendLiteral(" CAST(? AS TEXT) AND key ");
 
-    if (!keyRange.upperKey.isNull && !keyRange.upperOpen)
+    if (!keyRange.upperKey.isNull() && !keyRange.upperOpen)
         builder.appendLiteral("<=");
     else
         builder.append('<');
@@ -137,8 +137,8 @@
         m_boundID = m_objectStoreID;
     }
 
-    m_currentLowerKey = m_keyRange.lowerKey.isNull ? IDBKeyData::minimum() : m_keyRange.lowerKey;
-    m_currentUpperKey = m_keyRange.upperKey.isNull ? IDBKeyData::maximum() : m_keyRange.upperKey;
+    m_currentLowerKey = m_keyRange.lowerKey.isNull() ? IDBKeyData::minimum() : m_keyRange.lowerKey;
+    m_currentUpperKey = m_keyRange.upperKey.isNull() ? IDBKeyData::maximum() : m_keyRange.upperKey;
 
     return createSQLiteStatement(sql);
 }
@@ -147,8 +147,8 @@
 {
     LOG(IDB, "Creating cursor with SQL query: \"%s\"", sql.utf8().data());
 
-    ASSERT(!m_currentLowerKey.isNull);
-    ASSERT(!m_currentUpperKey.isNull);
+    ASSERT(!m_currentLowerKey.isNull());
+    ASSERT(!m_currentUpperKey.isNull());
     ASSERT(m_transaction->sqliteTransaction());
 
     m_statement = std::make_unique<SQLiteStatement>(m_transaction->sqliteTransaction()->database(), sql);
@@ -171,8 +171,8 @@
 
 void SQLiteIDBCursor::resetAndRebindStatement()
 {
-    ASSERT(!m_currentLowerKey.isNull);
-    ASSERT(!m_currentUpperKey.isNull);
+    ASSERT(!m_currentLowerKey.isNull());
+    ASSERT(!m_currentUpperKey.isNull());
     ASSERT(m_transaction->sqliteTransaction());
     ASSERT(m_statement);
     ASSERT(m_statementNeedsReset);
@@ -180,7 +180,7 @@
     m_statementNeedsReset = false;
 
     // If this cursor never fetched any records, we don't need to reset the statement.
-    if (m_currentKey.isNull)
+    if (m_currentKey.isNull())
         return;
 
     // Otherwise update the lower key or upper key used for the cursor range.
@@ -368,7 +368,7 @@
     bool result = advance(1);
 
     // Iterating with no key is equivalent to advancing 1 step.
-    if (targetKey.isNull || !result)
+    if (targetKey.isNull() || !result)
         return result;
 
     while (!m_completed) {

Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp (191619 => 191620)


--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp	2015-10-27 05:22:55 UTC (rev 191620)
@@ -762,7 +762,7 @@
     m_cursors.set(cursor->identifier(), cursor);
 
     std::unique_ptr<JSLockHolder> locker;
-    while (!cursor->currentKey().isNull) {
+    while (!cursor->currentKey().isNull()) {
         const IDBKeyData& key = cursor->currentKey();
         const Vector<uint8_t>& valueBuffer = cursor->currentValueBuffer();
 

Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp (191619 => 191620)


--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp	2015-10-27 05:22:55 UTC (rev 191620)
@@ -454,7 +454,7 @@
     if (!serverRequest)
         return;
 
-    serverRequest->completeRequest(resultKey.isNull ? nullptr : resultKey.maybeCreateIDBKey(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
+    serverRequest->completeRequest(resultKey.isNull() ? nullptr : resultKey.maybeCreateIDBKey(), errorCode ? IDBDatabaseError::create(errorCode, errorMessage) : nullptr);
 }
 
 void WebIDBServerConnection::didGetRecord(uint64_t requestID, const WebCore::IDBGetResult& getResult, uint32_t errorCode, const String& errorMessage)

Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h (191619 => 191620)


--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.h	2015-10-27 05:22:55 UTC (rev 191620)
@@ -34,7 +34,7 @@
 #include <WebCore/IDBServerConnection.h>
 
 namespace WebCore {
-struct IDBKeyData;
+class IDBKeyData;
 class SecurityOrigin;
 }
 

Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in (191619 => 191620)


--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in	2015-10-27 05:16:17 UTC (rev 191619)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in	2015-10-27 05:22:55 UTC (rev 191620)
@@ -40,11 +40,11 @@
     DidCreateIndex(uint64_t requestID, bool success)
     DidDeleteIndex(uint64_t requestID, bool success)
 
-    DidPutRecord(uint64_t requestID, struct WebCore::IDBKeyData resultKey, uint32_t errorCode, String errorMessage)
+    DidPutRecord(uint64_t requestID, WebCore::IDBKeyData resultKey, uint32_t errorCode, String errorMessage)
     DidGetRecord(uint64_t requestID, struct WebCore::IDBGetResult getResult, uint32_t errorCode, String errorMessage)
-    DidOpenCursor(uint64_t requestID, int64_t cursorID, struct WebCore::IDBKeyData key, struct WebCore::IDBKeyData primaryKey, IPC::DataReference value, uint32_t errorCode, String errorMessage)
-    DidAdvanceCursor(uint64_t requestID, struct WebCore::IDBKeyData key, struct WebCore::IDBKeyData primaryKey, IPC::DataReference value, uint32_t errorCode, String errorMessage)
-    DidIterateCursor(uint64_t requestID, struct WebCore::IDBKeyData key, struct WebCore::IDBKeyData primaryKey, IPC::DataReference value, uint32_t errorCode, String errorMessage)
+    DidOpenCursor(uint64_t requestID, int64_t cursorID, WebCore::IDBKeyData key, WebCore::IDBKeyData primaryKey, IPC::DataReference value, uint32_t errorCode, String errorMessage)
+    DidAdvanceCursor(uint64_t requestID, WebCore::IDBKeyData key, WebCore::IDBKeyData primaryKey, IPC::DataReference value, uint32_t errorCode, String errorMessage)
+    DidIterateCursor(uint64_t requestID, WebCore::IDBKeyData key, WebCore::IDBKeyData primaryKey, IPC::DataReference value, uint32_t errorCode, String errorMessage)
     DidCount(uint64_t requestID, int64_t count, uint32_t errorCode, String errorMessage)
     DidDeleteRange(uint64_t requestID, uint32_t errorCode, String errorMessage)
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to