Backed out 2 changesets (bug 1111135) for build bustage on a CLOSED TREE

Backed out changeset 0c6d384d9d65 (bug 1111135)
Backed out changeset 1ba35d7572b7 (bug 1111135)
This commit is contained in:
Wes Kocher 2015-01-05 15:32:08 -08:00
parent 88588f5cae
commit 8bb1b9d23b
3 changed files with 9 additions and 38 deletions

View File

@ -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,

View File

@ -545,33 +545,6 @@ private:
}
}
bool Check3gppPermission()
{
nsCOMPtr<nsIDocument> 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<nsIPermissionManager> 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<nsIDocument> 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);

View File

@ -148,8 +148,6 @@ private:
// Register MediaRecorder into Document to listen the activity changes.
void RegisterActivityObserver();
void UnRegisterActivityObserver();
bool Check3gppPermission();
};
}