Closed Bug 1484868 Opened 6 years ago Closed 6 years ago

Add the nsIPermissionManager::removeByType() API

Categories

(Core :: Permission Manager, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file)

I need this API for the implementation of the functionality in bug 1484788...
Blocks: 1484876
Priority: -- → P1
Comment on attachment 9002625 [details] [diff] [review]
Add the nsIPermissionManager::removeByType() API

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

::: extensions/cookie/nsPermissionManager.cpp
@@ +2120,5 @@
> +        continue;
> +      }
> +
> +      nsCOMPtr<nsIPermission> permission =
> +        nsPermission::Create(principal,

It looks like we're only creating these nsIPermission objects in order to iterate over them again in a second removal pass. I think I'd prefer to just collect a 
    nsTArray<Pair<nsCString, uint32_t>>

or similar to avoid the unnecessary object creation.

That being said, I see this code was originally from another method, and I'd be OK with doing that cleanup in a follow-up :-).
Attachment #9002625 - Flags: review?(nika) → review+
Filed bug 1485114 to address the review comment.
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/dade0d8f79ea
Add the nsIPermissionManager::removeByType() API; r=nika
https://hg.mozilla.org/mozilla-central/rev/dade0d8f79ea
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: