WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-92434-20120814135924.patch (text/plain), 9.28 KB, created by
Alec Flett
on 2012-08-14 13:59:57 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alec Flett
Created:
2012-08-14 13:59:57 PDT
Size:
9.28 KB
patch
obsolete
>Subversion Revision: 125526 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 207ff7be2296a20d86117af39fac37fa612027c2..8e825e2a1fe4a2ca9df4ec3042b93cfc6544fb0c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,34 @@ >+2012-08-14 Alec Flett <alecflett@chromium.org> >+ >+ IndexedDB: IDB*::keyPath should return IDBKeyPath, not IDBAny >+ https://bugs.webkit.org/show_bug.cgi?id=92434 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Clean up IDBKeyPath to be like the other IDBAny-encapsulated >+ objects. This gets rid of some implicit conversion from >+ IDBKeyPath to IDBAny. >+ >+ No new tests (OOPS!). >+ >+ * Modules/indexeddb/IDBAny.cpp: >+ (WebCore::IDBAny::set): >+ (WebCore): >+ * Modules/indexeddb/IDBAny.h: >+ (WebCore): >+ (WebCore::IDBAny::create): >+ (IDBAny): >+ * Modules/indexeddb/IDBIndex.h: >+ (WebCore::IDBIndex::keyPathAny): >+ (WebCore::IDBIndex::keyPath): >+ * Modules/indexeddb/IDBIndex.idl: >+ * Modules/indexeddb/IDBKeyPath.cpp: >+ * Modules/indexeddb/IDBKeyPath.h: >+ * Modules/indexeddb/IDBObjectStore.h: >+ (WebCore::IDBObjectStore::keyPathAny): >+ (WebCore::IDBObjectStore::keyPath): >+ * Modules/indexeddb/IDBObjectStore.idl: >+ > 2012-08-14 Sheriff Bot <webkit.review.bot@gmail.com> > > Unreviewed, rolling out r125519. >diff --git a/Source/WebCore/Modules/indexeddb/IDBAny.cpp b/Source/WebCore/Modules/indexeddb/IDBAny.cpp >index 30028ccfdfce9596040ac03efa49fab240702e32..19774132879bdd14d64b9c5a2d3b122abb5116fc 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBAny.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBAny.cpp >@@ -32,6 +32,7 @@ > #include "IDBDatabase.h" > #include "IDBFactory.h" > #include "IDBIndex.h" >+#include "IDBKeyPath.h" > #include "IDBObjectStore.h" > #include "SerializedScriptValue.h" > >@@ -207,6 +208,27 @@ void IDBAny::set(PassRefPtr<SerializedScriptValue> value) > m_serializedScriptValue = value; > } > >+void IDBAny::set(const IDBKeyPath& value) >+{ >+ ASSERT(m_type == UndefinedType); >+ switch (value.type()) { >+ case IDBKeyPath::NullType: >+ m_type = NullType; >+ break; >+ case IDBKeyPath::StringType: >+ m_type = StringType; >+ m_string = value.string(); >+ break; >+ case IDBKeyPath::ArrayType: >+ RefPtr<DOMStringList> keyPaths = DOMStringList::create(); >+ for (Vector<String>::const_iterator it = value.array().begin(); it != value.array().end(); ++it) >+ keyPaths->append(*it); >+ m_type = DOMStringListType; >+ m_domStringList = keyPaths; >+ break; >+ } >+} >+ > void IDBAny::set(const String& value) > { > ASSERT(m_type == UndefinedType); >diff --git a/Source/WebCore/Modules/indexeddb/IDBAny.h b/Source/WebCore/Modules/indexeddb/IDBAny.h >index 93eb2401daab8c8666e6846501d51b91069aabde..48618719c52dcccf021a2cad955eba4546bfe9e2 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBAny.h >+++ b/Source/WebCore/Modules/indexeddb/IDBAny.h >@@ -45,6 +45,7 @@ class IDBKey; > class IDBObjectStore; > class IDBTransaction; > class SerializedScriptValue; >+class IDBKeyPath; > > class IDBAny : public RefCounted<IDBAny> { > public: >@@ -58,6 +59,12 @@ public: > any->set(idbObject); > return any.release(); > } >+ static PassRefPtr<IDBAny> create(const IDBKeyPath& keyPath) >+ { >+ RefPtr<IDBAny> any = IDBAny::createInvalid(); >+ any->set(keyPath); >+ return any.release(); >+ } > template<typename T> > static PassRefPtr<IDBAny> create(PassRefPtr<T> idbObject) > { >@@ -109,6 +116,7 @@ public: > void set(PassRefPtr<IDBObjectStore>); > void set(PassRefPtr<IDBTransaction>); > void set(PassRefPtr<SerializedScriptValue>); >+ void set(const IDBKeyPath&); > void set(const String&); > > private: >diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.h b/Source/WebCore/Modules/indexeddb/IDBIndex.h >index 8201d5d333db91d5f300820944c07f6b88b98d8e..59e038836d2486eda6e7297689c62cd2c74c1d0f 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBIndex.h >+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.h >@@ -53,7 +53,8 @@ public: > // Implement the IDL > const String name() const { return m_metadata.name; } > PassRefPtr<IDBObjectStore> objectStore() const { return m_objectStore; } >- PassRefPtr<IDBAny> keyPath() const { return m_metadata.keyPath; } >+ PassRefPtr<IDBAny> keyPathAny() const { return IDBAny::create(m_metadata.keyPath); } >+ const IDBKeyPath keyPath() const { return m_metadata.keyPath; } > bool unique() const { return m_metadata.unique; } > bool multiEntry() const { return m_metadata.multiEntry; } > >diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.idl b/Source/WebCore/Modules/indexeddb/IDBIndex.idl >index a1708ca62c30d8a75b68226707fe2aa22bf9bcfc..7789236a14c778cd3c0e3010b5540bc28df7ee48 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBIndex.idl >+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.idl >@@ -30,7 +30,7 @@ module storage { > ] IDBIndex { > readonly attribute DOMString name; > readonly attribute IDBObjectStore objectStore; >- readonly attribute IDBAny keyPath; >+ readonly attribute [ImplementedAs=keyPathAny] IDBAny keyPath; > readonly attribute boolean unique; > readonly attribute boolean multiEntry; > >diff --git a/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp b/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp >index 8c7b84f9e84adecc5b80eebebdf4b200429297d8..0d7b821168c0fa7504ff5ac0f7a4265fc4831edc 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp >@@ -219,48 +219,6 @@ bool IDBKeyPath::isValid() const > return false; > } > >-IDBKeyPath::operator PassRefPtr<IDBAny>() const >-{ >- switch (m_type) { >- case NullType: >- return IDBAny::createNull(); >- case StringType: >- return IDBAny::createString(m_string); >- case ArrayType: >- RefPtr<DOMStringList> keyPaths = DOMStringList::create(); >- for (Vector<String>::const_iterator it = m_array.begin(); it != m_array.end(); ++it) >- keyPaths->append(*it); >- return IDBAny::create(static_cast<PassRefPtr<DOMStringList> >(keyPaths)); >- } >- ASSERT_NOT_REACHED(); >- return 0; >-} >- >-bool IDBKeyPath::operator==(PassRefPtr<IDBAny> other) const >-{ >- if (!isValid()) >- return false; >- >- switch (m_type) { >- case NullType: >- return other->type() == IDBAny::NullType; >- case StringType: >- return other->type() == IDBAny::StringType && other->string() == string(); >- case ArrayType: >- if (other->type() != IDBAny::DOMStringListType) >- return false; >- >- RefPtr<DOMStringList> otherList = other->domStringList(); >- for (size_t i = 0; i < m_array.size(); ++i) { >- if (otherList->item(i) != m_array[i]) >- return false; >- } >- return true; >- } >- ASSERT_NOT_REACHED(); >- return false; >-} >- > bool IDBKeyPath::operator==(const IDBKeyPath& other) const > { > if (m_type != other.m_type) >diff --git a/Source/WebCore/Modules/indexeddb/IDBKeyPath.h b/Source/WebCore/Modules/indexeddb/IDBKeyPath.h >index df31e2abc65eb7a327c9f5917835cc386a24a9f0..5244c8a1bb4446684eaf833fb8d8d87e75c9d93e 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBKeyPath.h >+++ b/Source/WebCore/Modules/indexeddb/IDBKeyPath.h >@@ -28,7 +28,6 @@ > > #if ENABLE(INDEXED_DATABASE) > >-#include "IDBAny.h" > #include "PlatformString.h" > #include <wtf/Vector.h> > >@@ -71,8 +70,6 @@ public: > > bool isNull() const { return m_type == NullType; } > bool isValid() const; >- operator PassRefPtr<IDBAny>() const; >- bool operator==(PassRefPtr<IDBAny> other) const; > bool operator==(const IDBKeyPath& other) const; > > private: >diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >index 6fefc4e2bad095ae6d1334c3ebb96fe9089b880f..ed432bf30f79964e69f9700855078efcbce36d98 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h >@@ -58,7 +58,8 @@ public: > > // Implement the IDBObjectStore IDL > const String name() const { return m_metadata.name; } >- PassRefPtr<IDBAny> keyPath() const { return m_metadata.keyPath; } >+ PassRefPtr<IDBAny> keyPathAny() const { return IDBAny::create(m_metadata.keyPath); } >+ const IDBKeyPath keyPath() const { return m_metadata.keyPath; } > PassRefPtr<DOMStringList> indexNames() const; > PassRefPtr<IDBTransaction> transaction() const { return m_transaction; } > bool autoIncrement() const { return m_metadata.autoIncrement; } >diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl b/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl >index 9ed1422b72d2065cf1c268459881f1a330c27b6c..64530a3aab1bc2382290be1e291f0bb71a7364ec 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl >+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl >@@ -29,7 +29,7 @@ module storage { > Conditional=INDEXED_DATABASE > ] IDBObjectStore { > readonly attribute [TreatReturnedNullStringAs=Null] DOMString name; >- readonly attribute IDBAny keyPath; >+ readonly attribute [ImplementedAs=keyPathAny] IDBAny keyPath; > readonly attribute DOMStringList indexNames; > readonly attribute IDBTransaction transaction; > readonly attribute boolean autoIncrement;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 92434
:
158410
|
158444
|
158582