Closed Bug 1162624 Opened 9 years ago Closed 9 years ago

Add support for restoring corrupted or missing metadata files

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: janv, Assigned: janv)

References

Details

Attachments

(3 files, 1 obsolete file)

      No description provided.
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → Jan.Varga
Status: NEW → ASSIGNED
Attachment #8602838 - Flags: review?(bent.mozilla)
Comment on attachment 8602838 [details] [diff] [review]
patch

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

::: dom/quota/QuotaManager.cpp
@@ +4497,5 @@
> +  if (NS_WARN_IF(NS_FAILED(rv))) {
> +    return rv;
> +  }
> +
> +  mCreate = aCreate;

This is a little weird, why do you set this after calling DoDirectoryWork?

@@ +4509,5 @@
> +  AssertIsOnIOThread();
> +  MOZ_ASSERT(mCreate);
> +
> +  nsCOMPtr<nsISimpleEnumerator> entries;
> +  nsresult rv = NS_NewSingletonEnumerator(getter_AddRefs(entries), mDirectory);

Wrapping this in extra COM goop is pretty unfortunate... You could also change DoDirectoryWork to have a sub-function that only takes a single directory, and then you call it once per directory, right? I guess I don't care a ton but it might be nicer.

@@ +4526,5 @@
> +nsresult
> +StorageDirectoryHelper::DoDirectoryWork(nsISimpleEnumerator* aEntries,
> +                                        bool aMove)
> +{
> +  AssertIsOnIOThread();

Nit: Might as well assert aEntries

@@ +4640,5 @@
>          return rv;
>        }
>  
>        // Move whitelisted origins to new persistent storage.
> +      if (mPersistent && aMove &&

Nit: One condition per line if they don't all fit on one.
Attachment #8602838 - Flags: review?(bent.mozilla) → review+
Attached patch patch v2Splinter Review
Attachment #8602838 - Attachment is obsolete: true
Attached patch interdiffSplinter Review
Attachment #8603427 - Flags: review+
Comment on attachment 8603427 [details] [diff] [review]
patch v2

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

::: dom/quota/QuotaManager.cpp
@@ +41,5 @@
>  #include "nsCharSeparatedTokenizer.h"
>  #include "nsContentUtils.h"
>  #include "nsCRTGlue.h"
>  #include "nsDirectoryServiceUtils.h"
> +#include "nsEnumeratorUtils.h"

forgot to remove this
https://hg.mozilla.org/mozilla-central/rev/3d43ed344355
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Blocks: 1107608
Blocks: 1143607
You need to log in before you can comment on or make changes to this bug.