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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 class ScriptState; | 54 class ScriptState; |
55 | 55 |
56 class MODULES_EXPORT IDBTransaction final | 56 class MODULES_EXPORT IDBTransaction final |
57 : public EventTargetWithInlineData, | 57 : public EventTargetWithInlineData, |
58 public ActiveScriptWrappable<IDBTransaction>, | 58 public ActiveScriptWrappable<IDBTransaction>, |
59 public ContextLifecycleObserver { | 59 public ContextLifecycleObserver { |
60 USING_GARBAGE_COLLECTED_MIXIN(IDBTransaction); | 60 USING_GARBAGE_COLLECTED_MIXIN(IDBTransaction); |
61 DEFINE_WRAPPERTYPEINFO(); | 61 DEFINE_WRAPPERTYPEINFO(); |
62 | 62 |
63 public: | 63 public: |
| 64 static IDBTransaction* createObserver(ExecutionContext*, |
| 65 int64_t, |
| 66 const HashSet<String>& scope, |
| 67 IDBDatabase*); |
| 68 |
64 static IDBTransaction* createNonVersionChange(ScriptState*, | 69 static IDBTransaction* createNonVersionChange(ScriptState*, |
65 int64_t, | 70 int64_t, |
66 const HashSet<String>& scope, | 71 const HashSet<String>& scope, |
67 WebIDBTransactionMode, | 72 WebIDBTransactionMode, |
68 IDBDatabase*); | 73 IDBDatabase*); |
69 static IDBTransaction* createVersionChange( | 74 static IDBTransaction* createVersionChange( |
70 ExecutionContext*, | 75 ExecutionContext*, |
71 int64_t, | 76 int64_t, |
72 IDBDatabase*, | 77 IDBDatabase*, |
73 IDBOpenDBRequest*, | 78 IDBOpenDBRequest*, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 return m_oldDatabaseMetadata.maxObjectStoreId; | 140 return m_oldDatabaseMetadata.maxObjectStoreId; |
136 } | 141 } |
137 | 142 |
138 protected: | 143 protected: |
139 // EventTarget | 144 // EventTarget |
140 DispatchEventResult dispatchEventInternal(Event*) override; | 145 DispatchEventResult dispatchEventInternal(Event*) override; |
141 | 146 |
142 private: | 147 private: |
143 using IDBObjectStoreMap = HeapHashMap<String, Member<IDBObjectStore>>; | 148 using IDBObjectStoreMap = HeapHashMap<String, Member<IDBObjectStore>>; |
144 | 149 |
| 150 // For observer transactions. |
| 151 IDBTransaction(ExecutionContext*, |
| 152 int64_t, |
| 153 const HashSet<String>& scope, |
| 154 IDBDatabase*); |
| 155 |
145 // For non-upgrade transactions. | 156 // For non-upgrade transactions. |
146 IDBTransaction(ScriptState*, | 157 IDBTransaction(ScriptState*, |
147 int64_t, | 158 int64_t, |
148 const HashSet<String>& scope, | 159 const HashSet<String>& scope, |
149 WebIDBTransactionMode, | 160 WebIDBTransactionMode, |
150 IDBDatabase*); | 161 IDBDatabase*); |
151 | 162 |
152 // For upgrade transactions. | 163 // For upgrade transactions. |
153 IDBTransaction(ExecutionContext*, | 164 IDBTransaction(ExecutionContext*, |
154 int64_t, | 165 int64_t, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // This does not include a snapshot of the database's object store / index | 251 // This does not include a snapshot of the database's object store / index |
241 // metadata. | 252 // metadata. |
242 // | 253 // |
243 // Only valid for versionchange transactions. | 254 // Only valid for versionchange transactions. |
244 IDBDatabaseMetadata m_oldDatabaseMetadata; | 255 IDBDatabaseMetadata m_oldDatabaseMetadata; |
245 }; | 256 }; |
246 | 257 |
247 } // namespace blink | 258 } // namespace blink |
248 | 259 |
249 #endif // IDBTransaction_h | 260 #endif // IDBTransaction_h |
OLD | NEW |