OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 class DOMError; | 34 class DOMError; |
35 class IDBDatabase; | 35 class IDBDatabase; |
36 | 36 |
37 class IDBDatabaseCallbacks : public GarbageCollectedFinalized<IDBDatabaseCallbac
ks> { | 37 class IDBDatabaseCallbacks : public GarbageCollectedFinalized<IDBDatabaseCallbac
ks> { |
38 public: | 38 public: |
39 static IDBDatabaseCallbacks* create(); | 39 static IDBDatabaseCallbacks* create(); |
40 virtual ~IDBDatabaseCallbacks(); | 40 virtual ~IDBDatabaseCallbacks(); |
41 void trace(Visitor*); | 41 virtual void trace(Visitor*); |
42 | 42 |
43 // IDBDatabaseCallbacks | 43 // IDBDatabaseCallbacks |
44 virtual void onForcedClose(); | 44 virtual void onForcedClose(); |
45 virtual void onVersionChange(int64_t oldVersion, int64_t newVersion); | 45 virtual void onVersionChange(int64_t oldVersion, int64_t newVersion); |
46 | 46 |
47 virtual void onAbort(int64_t transactionId, PassRefPtrWillBeRawPtr<DOMError>
); | 47 virtual void onAbort(int64_t transactionId, PassRefPtrWillBeRawPtr<DOMError>
); |
48 virtual void onComplete(int64_t transactionId); | 48 virtual void onComplete(int64_t transactionId); |
49 | 49 |
50 void connect(IDBDatabase*); | 50 void connect(IDBDatabase*); |
51 | 51 |
52 protected: | 52 protected: |
53 // Exposed to subclasses for unit tests. | 53 // Exposed to subclasses for unit tests. |
54 IDBDatabaseCallbacks(); | 54 IDBDatabaseCallbacks(); |
55 | 55 |
56 private: | 56 private: |
57 // The initial IDBOpenDBRequest, final IDBDatabase, and/or | 57 // The initial IDBOpenDBRequest, final IDBDatabase, and/or |
58 // WebIDBDatabaseCallbacks have strong references to an IDBDatabaseCallbacks | 58 // WebIDBDatabaseCallbacks have strong references to an IDBDatabaseCallbacks |
59 // object. | 59 // object. |
60 // Oilpan: We'd like to delete an IDBDatabase object by a | 60 // Oilpan: We'd like to delete an IDBDatabase object by a |
61 // GC. WebIDBDatabaseCallbacks can survive the GC, and IDBDatabaseCallbacks | 61 // GC. WebIDBDatabaseCallbacks can survive the GC, and IDBDatabaseCallbacks |
62 // can survive too. m_database should be a weak reference to avoid that an | 62 // can survive too. m_database should be a weak reference to avoid that an |
63 // IDBDatabase survives the GC with the IDBDatabaseCallbacks. | 63 // IDBDatabase survives the GC with the IDBDatabaseCallbacks. |
64 WeakMember<IDBDatabase> m_database; | 64 WeakMember<IDBDatabase> m_database; |
65 }; | 65 }; |
66 | 66 |
67 } // namespace blink | 67 } // namespace blink |
68 | 68 |
69 #endif // IDBDatabaseCallbacks_h | 69 #endif // IDBDatabaseCallbacks_h |
OLD | NEW |