| 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 15 matching lines...) Expand all Loading... |
| 26 #ifndef IDBTransaction_h | 26 #ifndef IDBTransaction_h |
| 27 #define IDBTransaction_h | 27 #define IDBTransaction_h |
| 28 | 28 |
| 29 #include "bindings/v8/ScriptWrappable.h" | 29 #include "bindings/v8/ScriptWrappable.h" |
| 30 #include "core/dom/ActiveDOMObject.h" | 30 #include "core/dom/ActiveDOMObject.h" |
| 31 #include "core/dom/DOMError.h" | 31 #include "core/dom/DOMError.h" |
| 32 #include "core/events/Event.h" | 32 #include "core/events/Event.h" |
| 33 #include "core/events/EventListener.h" | 33 #include "core/events/EventListener.h" |
| 34 #include "core/events/EventTarget.h" | 34 #include "core/events/EventTarget.h" |
| 35 #include "core/events/ThreadLocalEventNames.h" | 35 #include "core/events/ThreadLocalEventNames.h" |
| 36 #include "heap/Handle.h" |
| 36 #include "modules/indexeddb/IDBMetadata.h" | 37 #include "modules/indexeddb/IDBMetadata.h" |
| 37 #include "modules/indexeddb/IndexedDB.h" | 38 #include "modules/indexeddb/IndexedDB.h" |
| 38 #include "public/platform/WebIDBDatabase.h" | 39 #include "public/platform/WebIDBDatabase.h" |
| 39 #include "wtf/HashSet.h" | 40 #include "wtf/HashSet.h" |
| 40 #include "wtf/RefCounted.h" | 41 #include "wtf/RefCounted.h" |
| 41 | 42 |
| 42 namespace WebCore { | 43 namespace WebCore { |
| 43 | 44 |
| 44 class DOMError; | 45 class DOMError; |
| 45 class ExceptionState; | 46 class ExceptionState; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 68 | 69 |
| 69 int64_t id() const { return m_id; } | 70 int64_t id() const { return m_id; } |
| 70 bool isActive() const { return m_state == Active; } | 71 bool isActive() const { return m_state == Active; } |
| 71 bool isFinished() const { return m_state == Finished; } | 72 bool isFinished() const { return m_state == Finished; } |
| 72 bool isReadOnly() const { return m_mode == blink::WebIDBDatabase::Transactio
nReadOnly; } | 73 bool isReadOnly() const { return m_mode == blink::WebIDBDatabase::Transactio
nReadOnly; } |
| 73 bool isVersionChange() const { return m_mode == blink::WebIDBDatabase::Trans
actionVersionChange; } | 74 bool isVersionChange() const { return m_mode == blink::WebIDBDatabase::Trans
actionVersionChange; } |
| 74 | 75 |
| 75 // Implement the IDBTransaction IDL | 76 // Implement the IDBTransaction IDL |
| 76 const String& mode() const; | 77 const String& mode() const; |
| 77 IDBDatabase* db() const { return m_database.get(); } | 78 IDBDatabase* db() const { return m_database.get(); } |
| 78 PassRefPtr<DOMError> error() const { return m_error; } | 79 PassRefPtrWillBeRawPtr<DOMError> error() const { return m_error; } |
| 79 PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionState&); | 80 PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionState&); |
| 80 void abort(ExceptionState&); | 81 void abort(ExceptionState&); |
| 81 | 82 |
| 82 void registerRequest(IDBRequest*); | 83 void registerRequest(IDBRequest*); |
| 83 void unregisterRequest(IDBRequest*); | 84 void unregisterRequest(IDBRequest*); |
| 84 void objectStoreCreated(const String&, PassRefPtr<IDBObjectStore>); | 85 void objectStoreCreated(const String&, PassRefPtr<IDBObjectStore>); |
| 85 void objectStoreDeleted(const String&); | 86 void objectStoreDeleted(const String&); |
| 86 void setActive(bool); | 87 void setActive(bool); |
| 87 void setError(PassRefPtr<DOMError>); | 88 void setError(PassRefPtrWillBeRawPtr<DOMError>); |
| 88 | 89 |
| 89 DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); | 90 DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); |
| 90 DEFINE_ATTRIBUTE_EVENT_LISTENER(complete); | 91 DEFINE_ATTRIBUTE_EVENT_LISTENER(complete); |
| 91 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 92 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 92 | 93 |
| 93 void onAbort(PassRefPtr<DOMError>); | 94 void onAbort(PassRefPtrWillBeRawPtr<DOMError>); |
| 94 void onComplete(); | 95 void onComplete(); |
| 95 | 96 |
| 96 // EventTarget | 97 // EventTarget |
| 97 virtual const AtomicString& interfaceName() const OVERRIDE; | 98 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 98 virtual ExecutionContext* executionContext() const OVERRIDE; | 99 virtual ExecutionContext* executionContext() const OVERRIDE; |
| 99 | 100 |
| 100 using EventTarget::dispatchEvent; | 101 using EventTarget::dispatchEvent; |
| 101 virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; | 102 virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE; |
| 102 | 103 |
| 103 // ActiveDOMObject | 104 // ActiveDOMObject |
| (...skipping 13 matching lines...) Expand all Loading... |
| 117 }; | 118 }; |
| 118 | 119 |
| 119 int64_t m_id; | 120 int64_t m_id; |
| 120 RefPtr<IDBDatabase> m_database; | 121 RefPtr<IDBDatabase> m_database; |
| 121 const Vector<String> m_objectStoreNames; | 122 const Vector<String> m_objectStoreNames; |
| 122 IDBOpenDBRequest* m_openDBRequest; | 123 IDBOpenDBRequest* m_openDBRequest; |
| 123 const blink::WebIDBDatabase::TransactionMode m_mode; | 124 const blink::WebIDBDatabase::TransactionMode m_mode; |
| 124 State m_state; | 125 State m_state; |
| 125 bool m_hasPendingActivity; | 126 bool m_hasPendingActivity; |
| 126 bool m_contextStopped; | 127 bool m_contextStopped; |
| 127 RefPtr<DOMError> m_error; | 128 RefPtrWillBePersistent<DOMError> m_error; |
| 128 | 129 |
| 129 ListHashSet<RefPtr<IDBRequest> > m_requestList; | 130 ListHashSet<RefPtr<IDBRequest> > m_requestList; |
| 130 | 131 |
| 131 typedef HashMap<String, RefPtr<IDBObjectStore> > IDBObjectStoreMap; | 132 typedef HashMap<String, RefPtr<IDBObjectStore> > IDBObjectStoreMap; |
| 132 IDBObjectStoreMap m_objectStoreMap; | 133 IDBObjectStoreMap m_objectStoreMap; |
| 133 | 134 |
| 134 typedef HashSet<RefPtr<IDBObjectStore> > IDBObjectStoreSet; | 135 typedef HashSet<RefPtr<IDBObjectStore> > IDBObjectStoreSet; |
| 135 IDBObjectStoreSet m_deletedObjectStores; | 136 IDBObjectStoreSet m_deletedObjectStores; |
| 136 | 137 |
| 137 typedef HashMap<RefPtr<IDBObjectStore>, IDBObjectStoreMetadata> IDBObjectSto
reMetadataMap; | 138 typedef HashMap<RefPtr<IDBObjectStore>, IDBObjectStoreMetadata> IDBObjectSto
reMetadataMap; |
| 138 IDBObjectStoreMetadataMap m_objectStoreCleanupMap; | 139 IDBObjectStoreMetadataMap m_objectStoreCleanupMap; |
| 139 IDBDatabaseMetadata m_previousMetadata; | 140 IDBDatabaseMetadata m_previousMetadata; |
| 140 }; | 141 }; |
| 141 | 142 |
| 142 } // namespace WebCore | 143 } // namespace WebCore |
| 143 | 144 |
| 144 #endif // IDBTransaction_h | 145 #endif // IDBTransaction_h |
| OLD | NEW |