| 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 23 matching lines...) Expand all Loading... |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class ExecutionContext; | 36 class ExecutionContext; |
| 37 class IDBTransaction; | 37 class IDBTransaction; |
| 38 | 38 |
| 39 // This class keeps track of the transactions created during the current | 39 // This class keeps track of the transactions created during the current |
| 40 // Javascript execution context. Transactions have an internal |active| flag | 40 // Javascript execution context. Transactions have an internal |active| flag |
| 41 // which is set to true on creation, but must be set to false when control | 41 // which is set to true on creation, but must be set to false when control |
| 42 // returns to the event loop. | 42 // returns to the event loop. |
| 43 | 43 |
| 44 class IDBPendingTransactionMonitor : public NoBaseWillBeGarbageCollected<IDBPend
ingTransactionMonitor>, public WillBeHeapSupplement<ExecutionContext> { | 44 class IDBPendingTransactionMonitor : public Supplement<ExecutionContext> { |
| 45 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(IDBPendingTransactionMonitor); | |
| 46 DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(IDBPendingTransactionMonito
r); | |
| 47 WTF_MAKE_NONCOPYABLE(IDBPendingTransactionMonitor); | 45 WTF_MAKE_NONCOPYABLE(IDBPendingTransactionMonitor); |
| 48 | 46 |
| 49 public: | 47 public: |
| 50 static IDBPendingTransactionMonitor& from(WillBeHeapSupplementable<Execution
Context>&); | 48 static IDBPendingTransactionMonitor& from(Supplementable<ExecutionContext>&)
; |
| 51 virtual void trace(Visitor*) OVERRIDE; | 49 virtual ~IDBPendingTransactionMonitor(); |
| 50 // The trace functino doesn't work until ExecutionContext is moved to Oilpan |
| 51 // heap. |
| 52 virtual void trace(Visitor* visitor) OVERRIDE { Supplement<ExecutionContext>
::trace(visitor); } |
| 52 void addNewTransaction(IDBTransaction&); | 53 void addNewTransaction(IDBTransaction&); |
| 53 void deactivateNewTransactions(); | 54 void deactivateNewTransactions(); |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 IDBPendingTransactionMonitor(); | 57 IDBPendingTransactionMonitor(); |
| 57 static const char* supplementName(); | 58 static const char* supplementName(); |
| 58 | 59 |
| 59 PersistentHeapVectorWillBeHeapVector<Member<IDBTransaction> > m_transactions
; | 60 typedef PersistentHeapVector<Member<IDBTransaction> > TransactionList; |
| 61 TransactionList m_transactions; |
| 60 }; | 62 }; |
| 61 | 63 |
| 62 } // namespace blink | 64 } // namespace blink |
| 63 | 65 |
| 64 #endif // IDBPendingTransactionMonitor_h | 66 #endif // IDBPendingTransactionMonitor_h |
| OLD | NEW |