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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 class IDBFactoryBackendImpl : public IDBFactoryBackendInterface { | 45 class IDBFactoryBackendImpl : public IDBFactoryBackendInterface { |
46 public: | 46 public: |
47 static PassRefPtr<IDBFactoryBackendImpl> create() | 47 static PassRefPtr<IDBFactoryBackendImpl> create() |
48 { | 48 { |
49 return adoptRef(new IDBFactoryBackendImpl()); | 49 return adoptRef(new IDBFactoryBackendImpl()); |
50 } | 50 } |
51 virtual ~IDBFactoryBackendImpl(); | 51 virtual ~IDBFactoryBackendImpl(); |
52 | 52 |
53 // Notifications from weak pointers. | 53 // Notifications from weak pointers. |
54 virtual void removeIDBDatabaseBackend(const String& uniqueIdentifier); | 54 void removeIDBDatabaseBackend(const String& uniqueIdentifier); |
55 void addIDBBackingStore(const String& fileIdentifier, IDBBackingStore*); | 55 void addIDBBackingStore(const String& fileIdentifier, IDBBackingStore*); |
56 virtual void removeIDBBackingStore(const String& fileIdentifier); | 56 void removeIDBBackingStore(const String& fileIdentifier); |
57 | 57 |
58 virtual void getDatabaseNames(PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityO
rigin>, Frame*, const String& dataDir); | 58 virtual void getDatabaseNames(PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityO
rigin>, Frame*, const String& dataDir); |
59 | 59 |
60 virtual void open(const String& name, IDBCallbacks*, PassRefPtr<SecurityOrig
in>, Frame*, const String& dataDir); | 60 virtual void open(const String& name, IDBCallbacks*, PassRefPtr<SecurityOrig
in>, Frame*, const String& dataDir); |
61 virtual void openFromWorker(const String& name, IDBCallbacks*, PassRefPtr<Se
curityOrigin>, WorkerContext*, const String& dataDir); | 61 virtual void openFromWorker(const String& name, IDBCallbacks*, PassRefPtr<Se
curityOrigin>, WorkerContext*, const String& dataDir); |
62 virtual void deleteDatabase(const String& name, PassRefPtr<IDBCallbacks>, Pa
ssRefPtr<SecurityOrigin>, Frame*, const String& dataDir); | 62 virtual void deleteDatabase(const String& name, PassRefPtr<IDBCallbacks>, Pa
ssRefPtr<SecurityOrigin>, Frame*, const String& dataDir); |
63 | 63 |
64 protected: | 64 private: |
65 IDBFactoryBackendImpl(); | 65 IDBFactoryBackendImpl(); |
66 virtual PassRefPtr<IDBBackingStore> openBackingStore(PassRefPtr<SecurityOrig
in>, const String& dataDir); | 66 PassRefPtr<IDBBackingStore> openBackingStore(PassRefPtr<SecurityOrigin>, con
st String& dataDir); |
67 | |
68 private: | |
69 void openInternal(const String& name, IDBCallbacks*, PassRefPtr<SecurityOrig
in>, const String& dataDir); | 67 void openInternal(const String& name, IDBCallbacks*, PassRefPtr<SecurityOrig
in>, const String& dataDir); |
70 | 68 |
71 typedef HashMap<String, IDBDatabaseBackendImpl*> IDBDatabaseBackendMap; | 69 typedef HashMap<String, IDBDatabaseBackendImpl*> IDBDatabaseBackendMap; |
72 IDBDatabaseBackendMap m_databaseBackendMap; | 70 IDBDatabaseBackendMap m_databaseBackendMap; |
73 | 71 |
74 typedef HashMap<String, IDBBackingStore*> IDBBackingStoreMap; | 72 typedef HashMap<String, IDBBackingStore*> IDBBackingStoreMap; |
75 IDBBackingStoreMap m_backingStoreMap; | 73 IDBBackingStoreMap m_backingStoreMap; |
76 | 74 |
77 RefPtr<IDBTransactionCoordinator> m_transactionCoordinator; | 75 RefPtr<IDBTransactionCoordinator> m_transactionCoordinator; |
78 | 76 |
79 // Only one instance of the factory should exist at any given time. | 77 // Only one instance of the factory should exist at any given time. |
80 static IDBFactoryBackendImpl* idbFactoryBackendImpl; | 78 static IDBFactoryBackendImpl* idbFactoryBackendImpl; |
81 }; | 79 }; |
82 | 80 |
83 } // namespace WebCore | 81 } // namespace WebCore |
84 | 82 |
85 #endif | 83 #endif |
86 | 84 |
87 #endif // IDBFactoryBackendImpl_h | 85 #endif // IDBFactoryBackendImpl_h |
OLD | NEW |