| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } else { | 288 } else { |
| 289 if (!makeAllDirectories(pathBase)) { | 289 if (!makeAllDirectories(pathBase)) { |
| 290 LOG_ERROR("Unable to create IndexedDB database path %s", pathBase.ut
f8().data()); | 290 LOG_ERROR("Unable to create IndexedDB database path %s", pathBase.ut
f8().data()); |
| 291 HistogramSupport::histogramEnumeration("WebCore.IndexedDB.BackingSto
re.OpenStatus", IDBLevelDBBackingStoreOpenFailedDirectory, IDBLevelDBBackingStor
eOpenMax); | 291 HistogramSupport::histogramEnumeration("WebCore.IndexedDB.BackingSto
re.OpenStatus", IDBLevelDBBackingStoreOpenFailedDirectory, IDBLevelDBBackingStor
eOpenMax); |
| 292 return PassRefPtr<IDBBackingStore>(); | 292 return PassRefPtr<IDBBackingStore>(); |
| 293 } | 293 } |
| 294 | 294 |
| 295 String path = pathByAppendingComponent(pathBase, securityOrigin->databas
eIdentifier() + ".indexeddb.leveldb"); | 295 String path = pathByAppendingComponent(pathBase, securityOrigin->databas
eIdentifier() + ".indexeddb.leveldb"); |
| 296 | 296 |
| 297 db = LevelDBDatabase::open(path, comparator.get()); | 297 db = LevelDBDatabase::open(path, comparator.get()); |
| 298 bool knownSchema = isSchemaKnown(db.get()); | 298 if (db && !isSchemaKnown(db.get())) { |
| 299 if (!knownSchema) { | |
| 300 LOG_ERROR("IndexedDB backing store had unknown schema, treating it a
s failure to open"); | 299 LOG_ERROR("IndexedDB backing store had unknown schema, treating it a
s failure to open"); |
| 301 HistogramSupport::histogramEnumeration("WebCore.IndexedDB.BackingSto
re.OpenStatus", IDBLevelDBBackingStoreOpenFailedUnknownSchema, IDBLevelDBBacking
StoreOpenMax); | 300 HistogramSupport::histogramEnumeration("WebCore.IndexedDB.BackingSto
re.OpenStatus", IDBLevelDBBackingStoreOpenFailedUnknownSchema, IDBLevelDBBacking
StoreOpenMax); |
| 301 db.release(); |
| 302 } | 302 } |
| 303 | 303 |
| 304 if (db && knownSchema) | 304 if (db) |
| 305 HistogramSupport::histogramEnumeration("WebCore.IndexedDB.BackingSto
re.OpenStatus", IDBLevelDBBackingStoreOpenSuccess, IDBLevelDBBackingStoreOpenMax
); | 305 HistogramSupport::histogramEnumeration("WebCore.IndexedDB.BackingSto
re.OpenStatus", IDBLevelDBBackingStoreOpenSuccess, IDBLevelDBBackingStoreOpenMax
); |
| 306 else { | 306 else { |
| 307 LOG_ERROR("IndexedDB backing store open failed, attempting cleanup")
; | 307 LOG_ERROR("IndexedDB backing store open failed, attempting cleanup")
; |
| 308 bool success = LevelDBDatabase::destroy(path); | 308 bool success = LevelDBDatabase::destroy(path); |
| 309 if (!success) { | 309 if (!success) { |
| 310 LOG_ERROR("IndexedDB backing store cleanup failed"); | 310 LOG_ERROR("IndexedDB backing store cleanup failed"); |
| 311 HistogramSupport::histogramEnumeration("WebCore.IndexedDB.Backin
gStore.OpenStatus", IDBLevelDBBackingStoreOpenCleanupDestroyFailed, IDBLevelDBBa
ckingStoreOpenMax); | 311 HistogramSupport::histogramEnumeration("WebCore.IndexedDB.Backin
gStore.OpenStatus", IDBLevelDBBackingStoreOpenCleanupDestroyFailed, IDBLevelDBBa
ckingStoreOpenMax); |
| 312 return PassRefPtr<IDBBackingStore>(); | 312 return PassRefPtr<IDBBackingStore>(); |
| 313 } | 313 } |
| 314 | 314 |
| (...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1899 String path = pathByAppendingComponent(pathBase, securityOrigin->databaseIde
ntifier() + ".indexeddb.leveldb"); | 1899 String path = pathByAppendingComponent(pathBase, securityOrigin->databaseIde
ntifier() + ".indexeddb.leveldb"); |
| 1900 | 1900 |
| 1901 // FIXME: this is checking for presence of the domain, not the database itse
lf | 1901 // FIXME: this is checking for presence of the domain, not the database itse
lf |
| 1902 return fileExists(path+"/CURRENT"); | 1902 return fileExists(path+"/CURRENT"); |
| 1903 } | 1903 } |
| 1904 | 1904 |
| 1905 } // namespace WebCore | 1905 } // namespace WebCore |
| 1906 | 1906 |
| 1907 #endif // USE(LEVELDB) | 1907 #endif // USE(LEVELDB) |
| 1908 #endif // ENABLE(INDEXED_DATABASE) | 1908 #endif // ENABLE(INDEXED_DATABASE) |
| OLD | NEW |