Update storage when ServiceWorker registration fails.

RESOLVED FIXED in Firefox 39

Status

()

defect
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: nsm, Assigned: nsm)

Tracking

33 Branch
mozilla39
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox39 fixed)

Details

Attachments

(1 attachment)

If register() fails, remove the registration we've persisted.
Assignee: nobody → nsm.nikhil
Status: NEW → ASSIGNED
Comment on attachment 8562929 [details] [diff] [review]
Update storage when ServiceWorker registration fails

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

::: dom/workers/ServiceWorkerManager.cpp
@@ +2416,5 @@
> +{
> +  MOZ_ASSERT(aRegistration);
> +  MOZ_ASSERT(!aRegistration->IsControllingDocuments());
> +  MOZ_ASSERT(mServiceWorkerRegistrationInfos.Contains(aRegistration->mScope));
> +  ServiceWorkerManager::RemoveScope(mOrderedScopes, aRegistration->mScope);

you don't need ServiceWorkerManager:: right?

@@ +2436,5 @@
> +  PrincipalInfo principalInfo;
> +  if (NS_WARN_IF(NS_FAILED(PrincipalToPrincipalInfo(reg->mPrincipal,
> +                                                    &principalInfo)))) {
> +    //XXXnsm I can't think of any other reason a stored principal would fail to
> +    //convert.

then just do:
NS_ALWAYS_TRUE(NS_SUCCEEDED(PrincipalToPrincipalInfo(...
Attachment #8562929 - Flags: review?(amarchesini) → review+
https://hg.mozilla.org/mozilla-central/rev/2ebbc5550931
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.