| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 class DOMError; | 44 class DOMError; |
| 45 class ExceptionState; | 45 class ExceptionState; |
| 46 class IDBCursor; | 46 class IDBCursor; |
| 47 class IDBDatabase; | 47 class IDBDatabase; |
| 48 class IDBObjectStore; | 48 class IDBObjectStore; |
| 49 class IDBOpenDBRequest; | 49 class IDBOpenDBRequest; |
| 50 struct IDBObjectStoreMetadata; | 50 struct IDBObjectStoreMetadata; |
| 51 | 51 |
| 52 class IDBTransaction FINAL | 52 class IDBTransaction final |
| 53 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<IDBTransa
ction> | 53 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<IDBTransa
ction> |
| 54 , public EventTargetWithInlineData | 54 , public EventTargetWithInlineData |
| 55 , public ActiveDOMObject { | 55 , public ActiveDOMObject { |
| 56 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<I
DBTransaction>); | 56 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<I
DBTransaction>); |
| 57 DEFINE_WRAPPERTYPEINFO(); | 57 DEFINE_WRAPPERTYPEINFO(); |
| 58 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBTransaction); | 58 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBTransaction); |
| 59 public: | 59 public: |
| 60 static IDBTransaction* create(ScriptState*, int64_t, const Vector<String>& o
bjectStoreNames, WebIDBTransactionMode, IDBDatabase*); | 60 static IDBTransaction* create(ScriptState*, int64_t, const Vector<String>& o
bjectStoreNames, WebIDBTransactionMode, IDBDatabase*); |
| 61 static IDBTransaction* create(ScriptState*, int64_t, IDBDatabase*, IDBOpenDB
Request*, const IDBDatabaseMetadata& previousMetadata); | 61 static IDBTransaction* create(ScriptState*, int64_t, IDBDatabase*, IDBOpenDB
Request*, const IDBDatabaseMetadata& previousMetadata); |
| 62 virtual ~IDBTransaction(); | 62 virtual ~IDBTransaction(); |
| 63 virtual void trace(Visitor*) OVERRIDE; | 63 virtual void trace(Visitor*) override; |
| 64 | 64 |
| 65 static WebIDBTransactionMode stringToMode(const String&, ExceptionState&); | 65 static WebIDBTransactionMode stringToMode(const String&, ExceptionState&); |
| 66 | 66 |
| 67 // When the connection is closed backend will be 0. | 67 // When the connection is closed backend will be 0. |
| 68 WebIDBDatabase* backendDB() const; | 68 WebIDBDatabase* backendDB() const; |
| 69 | 69 |
| 70 int64_t id() const { return m_id; } | 70 int64_t id() const { return m_id; } |
| 71 bool isActive() const { return m_state == Active; } | 71 bool isActive() const { return m_state == Active; } |
| 72 bool isFinished() const { return m_state == Finished; } | 72 bool isFinished() const { return m_state == Finished; } |
| 73 bool isFinishing() const { return m_state == Finishing; } | 73 bool isFinishing() const { return m_state == Finishing; } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 89 void setError(DOMError*); | 89 void setError(DOMError*); |
| 90 | 90 |
| 91 DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); | 91 DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); |
| 92 DEFINE_ATTRIBUTE_EVENT_LISTENER(complete); | 92 DEFINE_ATTRIBUTE_EVENT_LISTENER(complete); |
| 93 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 93 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
| 94 | 94 |
| 95 void onAbort(DOMError*); | 95 void onAbort(DOMError*); |
| 96 void onComplete(); | 96 void onComplete(); |
| 97 | 97 |
| 98 // EventTarget | 98 // EventTarget |
| 99 virtual const AtomicString& interfaceName() const OVERRIDE; | 99 virtual const AtomicString& interfaceName() const override; |
| 100 virtual ExecutionContext* executionContext() const OVERRIDE; | 100 virtual ExecutionContext* executionContext() const override; |
| 101 | 101 |
| 102 using EventTarget::dispatchEvent; | 102 using EventTarget::dispatchEvent; |
| 103 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE; | 103 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) override; |
| 104 | 104 |
| 105 // ActiveDOMObject | 105 // ActiveDOMObject |
| 106 virtual bool hasPendingActivity() const OVERRIDE; | 106 virtual bool hasPendingActivity() const override; |
| 107 virtual void stop() OVERRIDE; | 107 virtual void stop() override; |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 IDBTransaction(ScriptState*, int64_t, const Vector<String>&, WebIDBTransacti
onMode, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata&); | 110 IDBTransaction(ScriptState*, int64_t, const Vector<String>&, WebIDBTransacti
onMode, IDBDatabase*, IDBOpenDBRequest*, const IDBDatabaseMetadata&); |
| 111 | 111 |
| 112 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); | 112 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); |
| 113 | 113 |
| 114 enum State { | 114 enum State { |
| 115 Inactive, // Created or started, but not in an event callback | 115 Inactive, // Created or started, but not in an event callback |
| 116 Active, // Created or started, in creation scope or an event callback | 116 Active, // Created or started, in creation scope or an event callback |
| 117 Finishing, // In the process of aborting or completing. | 117 Finishing, // In the process of aborting or completing. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 137 IDBObjectStoreSet m_deletedObjectStores; | 137 IDBObjectStoreSet m_deletedObjectStores; |
| 138 | 138 |
| 139 typedef HeapHashMap<Member<IDBObjectStore>, IDBObjectStoreMetadata> IDBObjec
tStoreMetadataMap; | 139 typedef HeapHashMap<Member<IDBObjectStore>, IDBObjectStoreMetadata> IDBObjec
tStoreMetadataMap; |
| 140 IDBObjectStoreMetadataMap m_objectStoreCleanupMap; | 140 IDBObjectStoreMetadataMap m_objectStoreCleanupMap; |
| 141 IDBDatabaseMetadata m_previousMetadata; | 141 IDBDatabaseMetadata m_previousMetadata; |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 } // namespace blink | 144 } // namespace blink |
| 145 | 145 |
| 146 #endif // IDBTransaction_h | 146 #endif // IDBTransaction_h |
| OLD | NEW |