Closed Bug 1485114 Opened Last year Closed Last year

Avoid creating nsPermission objects in the permission manager needlessly

Categories

(Core :: Permission Manager, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: ehsan, Assigned: ehsan)

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Assignee: nobody → ehsan
Attachment #9002877 - Attachment is obsolete: true
Attachment #9002879 - Flags: review?(nika)
Attachment #9002877 - Flags: review?(nika)
Comment on attachment 9002879 [details] [diff] [review]
Avoid creating nsPermission objects in the permission manager needlessly

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

::: extensions/cookie/nsPermissionManager.cpp
@@ +2705,5 @@
>  
>  nsresult
>  nsPermissionManager::RemovePermissionsWithAttributes(mozilla::OriginAttributesPattern& aPattern)
>  {
> +  AutoTArray<Pair<nsCOMPtr<nsIPrincipal>, nsCString>, 10> permissions;

It's a shame this one is still not using the common code. I presume this was to avoid double-parsing the nsIPrincipal?
Attachment #9002879 - Flags: review?(nika) → review+
(In reply to :Nika Layzell (digging out of backlog) from comment #3)
> Comment on attachment 9002879 [details] [diff] [review]
> Avoid creating nsPermission objects in the permission manager needlessly
> 
> Review of attachment 9002879 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: extensions/cookie/nsPermissionManager.cpp
> @@ +2705,5 @@
> >  
> >  nsresult
> >  nsPermissionManager::RemovePermissionsWithAttributes(mozilla::OriginAttributesPattern& aPattern)
> >  {
> > +  AutoTArray<Pair<nsCOMPtr<nsIPrincipal>, nsCString>, 10> permissions;
> 
> It's a shame this one is still not using the common code. I presume this was
> to avoid double-parsing the nsIPrincipal?

More because this function filters the principals stored in the permission table, but RemovePermissionEntries() filters the permission entries for each principal in the permission table.  IOW the filtering happens at different levels between the two.
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9b2e26f618a4
Avoid creating nsPermission objects in the permission manager needlessly; r=nika
https://hg.mozilla.org/mozilla-central/rev/9b2e26f618a4
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.