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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 : m_identifier(identifier) | 119 : m_identifier(identifier) |
120 , m_factory(factory) | 120 , m_factory(factory) |
121 , m_db(db) | 121 , m_db(db) |
122 { | 122 { |
123 m_factory->addIDBBackingStore(identifier, this); | 123 m_factory->addIDBBackingStore(identifier, this); |
124 } | 124 } |
125 | 125 |
126 IDBLevelDBBackingStore::~IDBLevelDBBackingStore() | 126 IDBLevelDBBackingStore::~IDBLevelDBBackingStore() |
127 { | 127 { |
128 m_factory->removeIDBBackingStore(m_identifier); | 128 m_factory->removeIDBBackingStore(m_identifier); |
| 129 |
| 130 // m_db's destructor uses m_comparator. The order of destruction is importan
t. |
| 131 m_db.clear(); |
| 132 m_comparator.clear(); |
129 } | 133 } |
130 | 134 |
131 PassRefPtr<IDBBackingStore> IDBLevelDBBackingStore::open(SecurityOrigin* securit
yOrigin, const String& pathBaseArg, int64_t maximumSize, const String& fileIdent
ifier, IDBFactoryBackendImpl* factory) | 135 PassRefPtr<IDBBackingStore> IDBLevelDBBackingStore::open(SecurityOrigin* securit
yOrigin, const String& pathBaseArg, int64_t maximumSize, const String& fileIdent
ifier, IDBFactoryBackendImpl* factory) |
132 { | 136 { |
133 String pathBase = pathBaseArg; | 137 String pathBase = pathBaseArg; |
134 | 138 |
135 if (pathBase.isEmpty()) { | 139 if (pathBase.isEmpty()) { |
136 ASSERT_NOT_REACHED(); // FIXME: We need to handle this case for incognit
o and DumpRenderTree. | 140 ASSERT_NOT_REACHED(); // FIXME: We need to handle this case for incognit
o and DumpRenderTree. |
137 return PassRefPtr<IDBBackingStore>(); | 141 return PassRefPtr<IDBBackingStore>(); |
138 } | 142 } |
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 // FIXME: this is checking for presence of the domain, not the database itse
lf | 1351 // FIXME: this is checking for presence of the domain, not the database itse
lf |
1348 return fileExists(path+"/CURRENT"); | 1352 return fileExists(path+"/CURRENT"); |
1349 } | 1353 } |
1350 | 1354 |
1351 // FIXME: deleteDatabase should be part of IDBBackingStore. | 1355 // FIXME: deleteDatabase should be part of IDBBackingStore. |
1352 | 1356 |
1353 } // namespace WebCore | 1357 } // namespace WebCore |
1354 | 1358 |
1355 #endif // ENABLE(LEVELDB) | 1359 #endif // ENABLE(LEVELDB) |
1356 #endif // ENABLE(INDEXED_DATABASE) | 1360 #endif // ENABLE(INDEXED_DATABASE) |
OLD | NEW |