Closed Bug 779353 Opened 12 years ago Closed 12 years ago

B2G Telephony: Hook up to permissions manager

Categories

(Core :: DOM: Device Interfaces, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17
blocking-basecamp +

People

(Reporter: gwagner, Assigned: hsinyi)

References

Details

Attachments

(2 files, 3 obsolete files)

The whitelist approach will go away pretty soon. We should update to the permissionManager approach.
https://mxr.mozilla.org/mozilla-central/source/content/base/src/nsContentUtils.cpp#6834
We should separate this into two bugs, one for telephony, and one for bluetooth..
blocking-basecamp: --- → ?
Dividing telephony and bluetooth into 2 seperate bugs. Bluetooth now Bug 779384
Summary: Hook up telephony and bluetooth to permission API → B2G Telephony: Hook up to permissions manager
Assignee: nobody → htsai
Attached patch Patch: testcase (obsolete) — Splinter Review
Attached patch Patch part2: testcase (obsolete) — Splinter Review
Attachment #649209 - Attachment is obsolete: true
Attachment #649208 - Attachment description: Patch: use nsIPermissionManager → Patch part1: use nsIPermissionManager
Attachment #649208 - Flags: review?(mounir)
Comment on attachment 649208 [details] [diff] [review]
Patch part1: use nsIPermissionManager

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

::: dom/telephony/Telephony.cpp
@@ +562,4 @@
>    NS_ENSURE_SUCCESS(rv, rv);
> +
> +  if (permission == nsIPermissionManager::UNKNOWN_ACTION ||
> +      permission == nsIPermissionManager::DENY_ACTION) {

if (permission != nsIPermissionManager::ALLOW_ACTON) {

@@ +566,5 @@
>      *aTelephony = nullptr;
>      return NS_OK;
>    }
> +  NS_ENSURE_SUCCESS(permission == nsIPermissionManager::ALLOW_ACTION,
> +                    NS_ERROR_FAILURE);

Remove that check.
Attachment #649208 - Flags: review?(mounir) → review+
Comment on attachment 649212 [details] [diff] [review]
Patch part2: testcase

Hi Philipp, 
Patch part1 passed mounir's review. Could you help review the modifications in telephony testcases? Thanks!
Attachment #649212 - Flags: review?(philipp)
Comment on attachment 649212 [details] [diff] [review]
Patch part2: testcase

Please don't get rid of the clean up. It serves the important purpose of giving each test a clean slate, at least permission-wise. Please use SpecialPowers.removePermission("telephony", document);
Attachment #649212 - Flags: review?(philipp) → review-
Updated according to Comment 8.
Attachment #649212 - Attachment is obsolete: true
Attached patch patch (part1) v2Splinter Review
Use nsIPermissionManager. Addressed Comment 6.
Attachment #649208 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/2898f99f375c
https://hg.mozilla.org/mozilla-central/rev/707a4a6340f0
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
blocking-basecamp: ? → +
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: