diff --git a/dom/apps/PermissionsTable.jsm b/dom/apps/PermissionsTable.jsm index a2033c681344..0f8d46078cd5 100644 --- a/dom/apps/PermissionsTable.jsm +++ b/dom/apps/PermissionsTable.jsm @@ -407,13 +407,7 @@ this.PermissionsTable = { geolocation: { privileged: PROMPT_ACTION, certified: ALLOW_ACTION }, - "audio-capture:3gpp": { - app: DENY_ACTION, - trusted: DENY_ACTION, - privileged: ALLOW_ACTION, - certified: ALLOW_ACTION - }, - "nfc": { + "nfc": { app: DENY_ACTION, trusted: DENY_ACTION, privileged: ALLOW_ACTION, diff --git a/dom/media/MediaRecorder.cpp b/dom/media/MediaRecorder.cpp index 29f800db480e..f616a69fa06a 100644 --- a/dom/media/MediaRecorder.cpp +++ b/dom/media/MediaRecorder.cpp @@ -545,33 +545,6 @@ private: } } - bool Check3gppPermission() - { - nsCOMPtr doc = mRecorder->GetOwner()->GetExtantDoc(); - if (!doc) { - return false; - } - - uint16_t appStatus = nsIPrincipal::APP_STATUS_NOT_INSTALLED; - doc->NodePrincipal()->GetAppStatus(&appStatus); - - // Certified applications can always assign AUDIO_3GPP - if (appStatus == nsIPrincipal::APP_STATUS_CERTIFIED) { - return true; - } - - nsCOMPtr pm = - do_GetService(NS_PERMISSIONMANAGER_CONTRACTID); - - if (!pm) { - return false; - } - - uint32_t perm = nsIPermissionManager::DENY_ACTION; - pm->TestExactPermissionFromPrincipal(doc->NodePrincipal(), "audio-capture:3gpp", &perm); - return perm == nsIPermissionManager::ALLOW_ACTION; - } - void InitEncoder(uint8_t aTrackTypes) { LOG(PR_LOG_DEBUG, ("Session.InitEncoder %p", this)); @@ -580,8 +553,14 @@ private: // Allocate encoder and bind with union stream. // At this stage, the API doesn't allow UA to choose the output mimeType format. - // Make sure the application has permission to assign AUDIO_3GPP - if (mRecorder->mMimeType.EqualsLiteral(AUDIO_3GPP) && Check3gppPermission()) { + nsCOMPtr doc = mRecorder->GetOwner()->GetExtantDoc(); + uint16_t appStatus = nsIPrincipal::APP_STATUS_NOT_INSTALLED; + if (doc) { + doc->NodePrincipal()->GetAppStatus(&appStatus); + } + // Only allow certificated application can assign AUDIO_3GPP + if (appStatus == nsIPrincipal::APP_STATUS_CERTIFIED && + mRecorder->mMimeType.EqualsLiteral(AUDIO_3GPP)) { mEncoder = MediaEncoder::CreateEncoder(NS_LITERAL_STRING(AUDIO_3GPP), aTrackTypes); } else { mEncoder = MediaEncoder::CreateEncoder(NS_LITERAL_STRING(""), aTrackTypes); diff --git a/dom/media/MediaRecorder.h b/dom/media/MediaRecorder.h index dad6fdfe3066..fbfb3595a5f5 100644 --- a/dom/media/MediaRecorder.h +++ b/dom/media/MediaRecorder.h @@ -148,8 +148,6 @@ private: // Register MediaRecorder into Document to listen the activity changes. void RegisterActivityObserver(); void UnRegisterActivityObserver(); - - bool Check3gppPermission(); }; }