Closed Bug 711727 Opened 14 years ago Closed 14 years ago

Followup cleanup for files in IndexedDB

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: janv, Assigned: janv)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

No description provided.
> /Users/varga/Sources/Mozilla5/mozilla-central/dom/indexedDB/ > IndexedDatabaseManager.cpp > @@ +679,5 @@ > > + // are database files then we need to create file managers for them and also > > + // tell SQLite about all of them. > > + > > + nsAutoTArray<nsString, 20> subdirectories; > > + nsAutoTArray<nsCOMPtr<nsIFile> , 20> unknownFiles; > > I'd like to change these to be hashsets, but we can do that in a followup. > fixed > @@ +755,3 @@ > > NS_ENSURE_SUCCESS(rv, rv); > > > > + rv = fileManager->InitDirectory(fileManagerDirectory, connection); > > Hm, can you combine FileManager::Init and FileManager::InitDirectory and > just call it Init? > > @@ +930,5 @@ > > > > if (!fileManager) { > > fileManager = new FileManager(aOrigin, aDatabaseName); > > > > + if (NS_FAILED(fileManager->Init())) { > > This is the only call to Init() without a followup for InitDirectory(). I > think we should change this to GetFileManager(), not GetOrCreate(), and just > return null here. Then DOMWindowUtils can deal accordingly. Can do in a > followup since this is only going to happen in mochitests. > fixed, however GetOrCreateFileManager() is still needed in OpenDatabaseHelper::CreateDatabaseConnection()
Attached patch patchSplinter Review
Assignee: nobody → Jan.Varga
Status: NEW → ASSIGNED
Attachment #582568 - Flags: review?(bent.mozilla)
Attachment #582903 - Flags: review?(bent.mozilla)
Attachment #582903 - Flags: review?(bent.mozilla) → review+
Comment on attachment 582568 [details] [diff] [review] patch r=me on everything except the IndexedDatabaseManager::EnsureOriginIsInitialized changes which bent better have a look at.
Attachment #582568 - Flags: review?(bent.mozilla) → review+
Comment on attachment 582568 [details] [diff] [review] patch Review of attachment 582568 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/indexedDB/IndexedDatabaseManager.cpp @@ +770,5 @@ > > rv = ss->UpdateQuotaInformationForFile(file); > NS_ENSURE_SUCCESS(rv, rv); > + > + validSubdirs.PutEntry(dbBaseFilename); This can fail, need to check.
Attachment #582568 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
Component: DOM → DOM: IndexedDB
Target Milestone: mozilla11 → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: