Closed Bug 1068787 Opened 5 years ago Closed 5 years ago

Quota usage not decreased when removing unsuccessfully copied files

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: janv, Assigned: janv)

Details

Attachments

(1 file, 2 obsolete files)

http://mxr.mozilla.org/mozilla-central/source/dom/indexedDB/ActorsParent.cpp#14780

Either remove it and the file will be removed when the FileInfo goes away or add proper quota manager call to decrease quota usage.

Also, I think we don't need to call flush in CopyFileData() if there's an error.
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → Jan.Varga
Status: NEW → ASSIGNED
Attachment #8496850 - Flags: review?(bent.mozilla)
Attached patch patch (obsolete) — Splinter Review
Forgot to update the thread assertion in QuotaManager::DecreaseUsageForOrigin()
Attachment #8496850 - Attachment is obsolete: true
Attachment #8496850 - Flags: review?(bent.mozilla)
Attachment #8505361 - Flags: review?(bent.mozilla)
Comment on attachment 8505361 [details] [diff] [review]
patch

Review of attachment 8505361 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/indexedDB/ActorsParent.cpp
@@ +14809,5 @@
>              // Try to remove the file if the copy failed.
> +            nsresult rv2;
> +            int64_t fileSize;
> +
> +            if (mFileManager->Privilege() != Chrome) {

This isn't actually right, is it? Installed non-chrome apps won't have quota tracking enabled, right?
Hm, then it's wrong elsewhere too.
It seems we need to expose mEnforcingQuota somehow and use that for checking.
Attached patch patchSplinter Review
Attachment #8505361 - Attachment is obsolete: true
Attachment #8505361 - Flags: review?(bent.mozilla)
Attachment #8506007 - Flags: review?(bent.mozilla)
Comment on attachment 8506007 [details] [diff] [review]
patch

Review of attachment 8506007 [details] [diff] [review]:
-----------------------------------------------------------------

Yay!
Attachment #8506007 - Flags: review?(bent.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/1ef63ad26842
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.