| 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 void removeIDBDatabaseBackend(const String& uniqueIdentifier); | 54 virtual void removeIDBDatabaseBackend(const String& uniqueIdentifier); |
| 55 void addIDBBackingStore(const String& fileIdentifier, IDBBackingStore*); | 55 void addIDBBackingStore(const String& fileIdentifier, IDBBackingStore*); |
| 56 void removeIDBBackingStore(const String& fileIdentifier); | 56 virtual 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: |
| 65 IDBFactoryBackendImpl(); |
| 66 virtual PassRefPtr<IDBBackingStore> openBackingStore(PassRefPtr<SecurityOrig
in>, const String& dataDir); |
| 67 |
| 64 private: | 68 private: |
| 65 IDBFactoryBackendImpl(); | |
| 66 PassRefPtr<IDBBackingStore> openBackingStore(PassRefPtr<SecurityOrigin>, con
st String& dataDir); | |
| 67 void openInternal(const String& name, IDBCallbacks*, PassRefPtr<SecurityOrig
in>, const String& dataDir); | 69 void openInternal(const String& name, IDBCallbacks*, PassRefPtr<SecurityOrig
in>, const String& dataDir); |
| 68 | 70 |
| 69 typedef HashMap<String, IDBDatabaseBackendImpl*> IDBDatabaseBackendMap; | 71 typedef HashMap<String, IDBDatabaseBackendImpl*> IDBDatabaseBackendMap; |
| 70 IDBDatabaseBackendMap m_databaseBackendMap; | 72 IDBDatabaseBackendMap m_databaseBackendMap; |
| 71 | 73 |
| 72 typedef HashMap<String, IDBBackingStore*> IDBBackingStoreMap; | 74 typedef HashMap<String, IDBBackingStore*> IDBBackingStoreMap; |
| 73 IDBBackingStoreMap m_backingStoreMap; | 75 IDBBackingStoreMap m_backingStoreMap; |
| 74 | 76 |
| 75 RefPtr<IDBTransactionCoordinator> m_transactionCoordinator; | 77 RefPtr<IDBTransactionCoordinator> m_transactionCoordinator; |
| 76 | 78 |
| 77 // Only one instance of the factory should exist at any given time. | 79 // Only one instance of the factory should exist at any given time. |
| 78 static IDBFactoryBackendImpl* idbFactoryBackendImpl; | 80 static IDBFactoryBackendImpl* idbFactoryBackendImpl; |
| 79 }; | 81 }; |
| 80 | 82 |
| 81 } // namespace WebCore | 83 } // namespace WebCore |
| 82 | 84 |
| 83 #endif | 85 #endif |
| 84 | 86 |
| 85 #endif // IDBFactoryBackendImpl_h | 87 #endif // IDBFactoryBackendImpl_h |
| OLD | NEW |