Upstream version 11.39.250.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / indexeddb / IDBPendingTransactionMonitor.h
index fc2d943..3dbcca0 100644 (file)
 
 namespace blink {
 
+class IDBCursor;
+class IDBDisposerDispatcher;
+class IDBRequest;
 class IDBTransaction;
 
 // This class keeps track of the transactions created during the current
 // Javascript execution context. Transactions have an internal |active| flag
 // which is set to true on creation, but must be set to false when control
 // returns to the event loop.
-
+// Also, this class is responsible to call IDBRequest::dispose() before an
+// IDBRequest object dies, and responsible to call IDBCursor::dispose() before
+// an IDBCursor object dies.
+// FIXME: Rename the class name.
 class IDBPendingTransactionMonitor {
     WTF_MAKE_NONCOPYABLE(IDBPendingTransactionMonitor);
 
 public:
     IDBPendingTransactionMonitor();
+    ~IDBPendingTransactionMonitor();
 
     void addNewTransaction(IDBTransaction&);
     void deactivateNewTransactions();
+    void registerRequest(IDBRequest&);
+    // It's ok to call unregisterRequest(*this) inside
+    // IDBRequest::dispose(). But we must not call unregisterRequest() with
+    // an object different from |this| of IDBRequest::dispose().
+    void unregisterRequest(IDBRequest&);
+    void registerCursor(IDBCursor&);
+    // It's ok to call unregisterCursor(*this) inside IDBCursor::dispose(). But
+    // we must not call unregisterCursor() with an object different from |this|
+    // of IDBCursor::dispose().
+    void unregisterCursor(IDBCursor&);
 
 private:
     PersistentHeapVector<Member<IDBTransaction> > m_transactions;
+    RefPtr<IDBDisposerDispatcher> m_dispatcher;
 };
 
 } // namespace blink