Bug 608195 - 'IndexedDB: Expose more breadcrumbs on IDB objects'. r=sicking, a=blocking+.

This commit is contained in:
Ben Turner 2010-12-09 18:14:09 -08:00
Родитель 33bda8235b
Коммит 97349c8f41
8 изменённых файлов: 54 добавлений и 4 удалений

Просмотреть файл

@ -328,6 +328,16 @@ IDBCursor::GetDirection(PRUint16* aDirection)
return NS_OK;
}
NS_IMETHODIMP
IDBCursor::GetSource(nsISupports** aSource)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
return mType == OBJECTSTORE ?
CallQueryInterface(mObjectStore, aSource) :
CallQueryInterface(mIndex, aSource);
}
NS_IMETHODIMP
IDBCursor::GetKey(nsIVariant** aKey)
{

Просмотреть файл

@ -326,6 +326,16 @@ IDBIndex::GetUnique(PRBool* aUnique)
return NS_OK;
}
NS_IMETHODIMP
IDBIndex::GetObjectStore(nsIIDBObjectStore** aObjectStore)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
nsCOMPtr<nsIIDBObjectStore> objectStore(mObjectStore);
objectStore.forget(aObjectStore);
return NS_OK;
}
NS_IMETHODIMP
IDBIndex::Get(nsIVariant* aKey,
nsIIDBRequest** _retval)

Просмотреть файл

@ -884,6 +884,16 @@ IDBObjectStore::GetKeyPath(nsAString& aKeyPath)
return NS_OK;
}
NS_IMETHODIMP
IDBObjectStore::GetTransaction(nsIIDBTransaction** aTransaction)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
nsCOMPtr<nsIIDBTransaction> transaction(mTransaction);
transaction.forget(aTransaction);
return NS_OK;
}
NS_IMETHODIMP
IDBObjectStore::GetIndexNames(nsIDOMDOMStringList** aIndexNames)
{

Просмотреть файл

@ -97,6 +97,16 @@ IDBRequest::GetReadyState(PRUint16* aReadyState)
return NS_OK;
}
NS_IMETHODIMP
IDBRequest::GetSource(nsISupports** aSource)
{
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
nsCOMPtr<nsISupports> source(mSource);
source.forget(aSource);
return NS_OK;
}
NS_IMETHODIMP
IDBRequest::SetOnsuccess(nsIDOMEventListener* aSuccessListener)
{

Просмотреть файл

@ -51,7 +51,7 @@ interface nsIVariant;
* http://dev.w3.org/2006/webapi/WebSimpleDB/#idl-def-IDBCursor for more
* information.
*/
[scriptable, uuid(7cb9820f-dd23-49e2-b1df-08543162cf40)]
[scriptable, uuid(17cae1b9-b438-4cee-8d36-a2dc5f517c02)]
interface nsIIDBCursor : nsISupports
{
const unsigned short NEXT = 0;
@ -60,6 +60,8 @@ interface nsIIDBCursor : nsISupports
const unsigned short PREV_NO_DUPLICATE = 3;
readonly attribute unsigned short direction;
readonly attribute nsISupports source;
readonly attribute nsIVariant key;
[implicit_jscontext]

Просмотреть файл

@ -40,6 +40,7 @@
#include "nsISupports.idl"
interface nsIIDBKeyRange;
interface nsIIDBObjectStore;
interface nsIIDBRequest;
interface nsIVariant;
@ -48,7 +49,7 @@ interface nsIVariant;
* http://dev.w3.org/2006/webapi/WebSimpleDB/#idl-def-IDBIndex for more
* information.
*/
[scriptable, uuid(077bcaab-f5b1-4ed8-a2b4-e4a3eb6bf6de)]
[scriptable, uuid(b44450e2-4a44-41e8-b098-1a7b389634b5)]
interface nsIIDBIndex : nsISupports
{
readonly attribute DOMString name;
@ -59,6 +60,8 @@ interface nsIIDBIndex : nsISupports
readonly attribute boolean unique;
readonly attribute nsIIDBObjectStore objectStore;
nsIIDBRequest
get(in nsIVariant key);

Просмотреть файл

@ -42,6 +42,7 @@
interface nsIIDBIndex;
interface nsIIDBKeyRange;
interface nsIIDBRequest;
interface nsIIDBTransaction;
interface nsIVariant;
interface nsIDOMDOMStringList;
@ -54,7 +55,7 @@ interface nsIDOMDOMStringList;
* http://dev.w3.org/2006/webapi/WebSimpleDB/#idl-def-nsIIDBObjectStore
* for more information.
*/
[scriptable, uuid(83c3fa8f-b061-4cb7-adb2-d1aec62f134c)]
[scriptable, uuid(626fd729-d66a-4b49-bbaf-058f1c375449)]
interface nsIIDBObjectStore : nsISupports
{
readonly attribute DOMString name;
@ -63,6 +64,8 @@ interface nsIIDBObjectStore : nsISupports
readonly attribute nsIDOMDOMStringList indexNames;
readonly attribute nsIIDBTransaction transaction;
// Success fires IDBTransactionEvent, result == value for key
nsIIDBRequest
get(in nsIVariant key);

Просмотреть файл

@ -47,13 +47,15 @@ interface nsIDOMEventListener;
* http://dev.w3.org/2006/webapi/WebSimpleDB/#idl-def-IDBRequest for more
* information.
*/
[scriptable, uuid(162f308f-a3eb-447c-95ee-d96bf3f78c64)]
[scriptable, uuid(5d55f15e-9521-4c98-ba0f-e8c07783d8d3)]
interface nsIIDBRequest : nsISupports
{
const unsigned short LOADING = 1;
const unsigned short DONE = 2;
readonly attribute unsigned short readyState;
readonly attribute nsISupports source;
attribute nsIDOMEventListener onsuccess;
attribute nsIDOMEventListener onerror;