Closed Bug 1238723 Opened 8 years ago Closed 8 years ago

tab child needs to use default user context id when handling permissions.

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: huseby, Assigned: huseby)

References

Details

(Whiteboard: [userContextId][OA])

Attachments

(1 file, 1 obsolete file)

in the file dom/ipc/ContentChild.cpp there's code for creating a principal when handling an add permission message:

> 2413     nsAutoCString originNoSuffix;
> 2414     PrincipalOriginAttributes attrs;
> 2415     attrs.PopulateFromOrigin(permission.origin, originNoSuffix);
> 2416
> 2417     nsCOMPtr<nsIURI> uri;
> 2418     nsresult rv = NS_NewURI(getter_AddRefs(uri), originNoSuffix);
> 2419     NS_ENSURE_SUCCESS(rv, true);
> 2420
> 2421     nsCOMPtr<nsIPrincipal> principal = mozilla::BasePrincipal::CreateCodebasePrincipal(uri, attrs);

because this is dealing with a permission, we need to change the PrincipalOriginAttribute object to a DefaultContextOriginAttributes object to force the user context to the default one.
This appears to work correctly.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Going to reopen to add some asserts in here just in case.
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Attached patch Bug_1238723.patch (obsolete) — Splinter Review
Comment on attachment 8717725 [details] [diff] [review]
Bug_1238723.patch

this one is good to go.
Attachment #8717725 - Flags: review?(jonas)
Comment on attachment 8717725 [details] [diff] [review]
Bug_1238723.patch

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

Maybe add a comment staying that we're only doing this since we don't yet support permissions on a per-user-context basis.
Attachment #8717725 - Flags: review?(jonas) → review+
already r+ by :sicking.  this adds the comment he requested and adds a better commit message.
Attachment #8717725 - Attachment is obsolete: true
Attachment #8737428 - Flags: review+
Keywords: checkin-needed
Whiteboard: [userContextId]
https://hg.mozilla.org/mozilla-central/rev/a28d0f76c03b
Status: REOPENED → RESOLVED
Closed: 8 years ago8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Whiteboard: [userContextId] → [userContextId][OA]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.