| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "modules/indexeddb/IDBTransaction.h" | 38 #include "modules/indexeddb/IDBTransaction.h" |
| 39 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
| 40 #include "wtf/RefCounted.h" | 40 #include "wtf/RefCounted.h" |
| 41 #include "wtf/RefPtr.h" | 41 #include "wtf/RefPtr.h" |
| 42 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
| 43 | 43 |
| 44 namespace WebCore { | 44 namespace WebCore { |
| 45 | 45 |
| 46 class DOMStringList; | 46 class DOMStringList; |
| 47 class IDBAny; | 47 class IDBAny; |
| 48 class ExceptionState; |
| 49 |
| 50 typedef int ExceptionCode; |
| 48 | 51 |
| 49 class IDBObjectStore : public ScriptWrappable, public RefCounted<IDBObjectStore>
{ | 52 class IDBObjectStore : public ScriptWrappable, public RefCounted<IDBObjectStore>
{ |
| 50 public: | 53 public: |
| 51 static PassRefPtr<IDBObjectStore> create(const IDBObjectStoreMetadata& metad
ata, IDBTransaction* transaction) | 54 static PassRefPtr<IDBObjectStore> create(const IDBObjectStoreMetadata& metad
ata, IDBTransaction* transaction) |
| 52 { | 55 { |
| 53 return adoptRef(new IDBObjectStore(metadata, transaction)); | 56 return adoptRef(new IDBObjectStore(metadata, transaction)); |
| 54 } | 57 } |
| 55 ~IDBObjectStore() { } | 58 ~IDBObjectStore() { } |
| 56 | 59 |
| 57 // Implement the IDBObjectStore IDL | 60 // Implement the IDBObjectStore IDL |
| (...skipping 10 matching lines...) Expand all Loading... |
| 68 PassRefPtr<IDBRequest> get(ScriptExecutionContext*, const ScriptValue& key,
ExceptionCode&); | 71 PassRefPtr<IDBRequest> get(ScriptExecutionContext*, const ScriptValue& key,
ExceptionCode&); |
| 69 PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>,
ExceptionCode&); | 72 PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>,
ExceptionCode&); |
| 70 PassRefPtr<IDBRequest> add(ScriptState*, ScriptValue&, const ScriptValue& ke
y, ExceptionCode&); | 73 PassRefPtr<IDBRequest> add(ScriptState*, ScriptValue&, const ScriptValue& ke
y, ExceptionCode&); |
| 71 PassRefPtr<IDBRequest> put(ScriptState*, ScriptValue&, const ScriptValue& ke
y, ExceptionCode&); | 74 PassRefPtr<IDBRequest> put(ScriptState*, ScriptValue&, const ScriptValue& ke
y, ExceptionCode&); |
| 72 PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, PassRefPtr<ID
BKeyRange>, ExceptionCode&); | 75 PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, PassRefPtr<ID
BKeyRange>, ExceptionCode&); |
| 73 PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, const ScriptV
alue& key, ExceptionCode&); | 76 PassRefPtr<IDBRequest> deleteFunction(ScriptExecutionContext*, const ScriptV
alue& key, ExceptionCode&); |
| 74 PassRefPtr<IDBRequest> clear(ScriptExecutionContext*, ExceptionCode&); | 77 PassRefPtr<IDBRequest> clear(ScriptExecutionContext*, ExceptionCode&); |
| 75 | 78 |
| 76 PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const Stri
ng& name, const String& keyPath, const Dictionary& options, ExceptionCode& ec) {
return createIndex(context, name, IDBKeyPath(keyPath), options, ec); } | 79 PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const Stri
ng& name, const String& keyPath, const Dictionary& options, ExceptionCode& ec) {
return createIndex(context, name, IDBKeyPath(keyPath), options, ec); } |
| 77 PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const Stri
ng& name, const Vector<String>& keyPath, const Dictionary& options, ExceptionCod
e& ec) { return createIndex(context, name, IDBKeyPath(keyPath), options, ec); } | 80 PassRefPtr<IDBIndex> createIndex(ScriptExecutionContext* context, const Stri
ng& name, const Vector<String>& keyPath, const Dictionary& options, ExceptionCod
e& ec) { return createIndex(context, name, IDBKeyPath(keyPath), options, ec); } |
| 78 PassRefPtr<IDBIndex> index(const String& name, ExceptionCode&); | 81 PassRefPtr<IDBIndex> index(const String& name, ExceptionState&); |
| 79 void deleteIndex(const String& name, ExceptionCode&); | 82 void deleteIndex(const String& name, ExceptionState&); |
| 80 | 83 |
| 81 PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange
>, ExceptionCode&); | 84 PassRefPtr<IDBRequest> count(ScriptExecutionContext*, PassRefPtr<IDBKeyRange
>, ExceptionCode&); |
| 82 PassRefPtr<IDBRequest> count(ScriptExecutionContext*, const ScriptValue& key
, ExceptionCode&); | 85 PassRefPtr<IDBRequest> count(ScriptExecutionContext*, const ScriptValue& key
, ExceptionCode&); |
| 83 | 86 |
| 84 // Used by IDBCursor::update(): | 87 // Used by IDBCursor::update(): |
| 85 PassRefPtr<IDBRequest> put(IDBDatabaseBackendInterface::PutMode, PassRefPtr<
IDBAny> source, ScriptState*, ScriptValue&, PassRefPtr<IDBKey>, ExceptionCode&); | 88 PassRefPtr<IDBRequest> put(IDBDatabaseBackendInterface::PutMode, PassRefPtr<
IDBAny> source, ScriptState*, ScriptValue&, PassRefPtr<IDBKey>, ExceptionCode&); |
| 86 | 89 |
| 87 void markDeleted() { m_deleted = true; } | 90 void markDeleted() { m_deleted = true; } |
| 88 bool isDeleted() const { return m_deleted; } | 91 bool isDeleted() const { return m_deleted; } |
| 89 void transactionFinished(); | 92 void transactionFinished(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 114 RefPtr<IDBTransaction> m_transaction; | 117 RefPtr<IDBTransaction> m_transaction; |
| 115 bool m_deleted; | 118 bool m_deleted; |
| 116 | 119 |
| 117 typedef HashMap<String, RefPtr<IDBIndex> > IDBIndexMap; | 120 typedef HashMap<String, RefPtr<IDBIndex> > IDBIndexMap; |
| 118 IDBIndexMap m_indexMap; | 121 IDBIndexMap m_indexMap; |
| 119 }; | 122 }; |
| 120 | 123 |
| 121 } // namespace WebCore | 124 } // namespace WebCore |
| 122 | 125 |
| 123 #endif // IDBObjectStore_h | 126 #endif // IDBObjectStore_h |
| OLD | NEW |