зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1369314 - Get rid of nsScriptSecurityManager::GetAppCodebasePrincipal, r=bholley
This commit is contained in:
Родитель
884d9efc73
Коммит
1cb008c2f2
|
@ -133,18 +133,6 @@ interface nsIScriptSecurityManager : nsISupports
|
|||
*/
|
||||
nsIPrincipal getSystemPrincipal();
|
||||
|
||||
/**
|
||||
* Returns a principal that has the given information.
|
||||
* @param appId is the app id of the principal. It can't be UNKNOWN_APP_ID.
|
||||
* @param inMozBrowser is true if the principal has to be considered as
|
||||
* inside a mozbrowser frame.
|
||||
*
|
||||
* @deprecated use createCodebasePrincipal instead.
|
||||
*/
|
||||
[deprecated] nsIPrincipal getAppCodebasePrincipal(in nsIURI uri,
|
||||
in unsigned long appId,
|
||||
in boolean inMozBrowser);
|
||||
|
||||
/**
|
||||
* Returns a principal that has the appId and inMozBrowser of the load
|
||||
* context.
|
||||
|
|
|
@ -1164,21 +1164,6 @@ nsScriptSecurityManager::CreateNullPrincipal(JS::Handle<JS::Value> aOriginAttrib
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScriptSecurityManager::GetAppCodebasePrincipal(nsIURI* aURI,
|
||||
uint32_t aAppId,
|
||||
bool aInIsolatedMozBrowser,
|
||||
nsIPrincipal** aPrincipal)
|
||||
{
|
||||
NS_ENSURE_TRUE(aAppId != nsIScriptSecurityManager::UNKNOWN_APP_ID,
|
||||
NS_ERROR_INVALID_ARG);
|
||||
|
||||
OriginAttributes attrs(aAppId, aInIsolatedMozBrowser);
|
||||
nsCOMPtr<nsIPrincipal> prin = BasePrincipal::CreateCodebasePrincipal(aURI, attrs);
|
||||
prin.forget(aPrincipal);
|
||||
return *aPrincipal ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsScriptSecurityManager::
|
||||
GetLoadContextCodebasePrincipal(nsIURI* aURI,
|
||||
|
|
|
@ -430,14 +430,6 @@ var tearDownServiceInParent = Task.async(function* (db) {
|
|||
ok(record.pushEndpoint.startsWith('https://example.org/push'),
|
||||
'Wrong push endpoint in subscription record');
|
||||
|
||||
record = yield db.getByIdentifiers({
|
||||
scope: 'https://example.net/scope/1',
|
||||
originAttributes: ChromeUtils.originAttributesToSuffix(
|
||||
{ appId: 1, inIsolatedMozBrowser: true }),
|
||||
});
|
||||
ok(record.pushEndpoint.startsWith('https://example.org/push'),
|
||||
'Wrong push endpoint in app record');
|
||||
|
||||
record = yield db.getByKeyID('3a414737-2fd0-44c0-af05-7efc172475fc');
|
||||
ok(!record, 'Unsubscribed record should not exist');
|
||||
});
|
||||
|
|
|
@ -229,27 +229,6 @@ add_test(function test_unsubscribe_error() {
|
|||
);
|
||||
});
|
||||
|
||||
add_test(function test_subscribe_app_principal() {
|
||||
let principal = Services.scriptSecurityManager.getAppCodebasePrincipal(
|
||||
Services.io.newURI('https://example.net/app/1'),
|
||||
1, /* appId */
|
||||
true /* browserOnly */
|
||||
);
|
||||
|
||||
do_test_pending();
|
||||
PushServiceComponent.subscribe('https://example.net/scope/1', principal, (result, subscription) => {
|
||||
ok(Components.isSuccessCode(result), 'Error creating subscription');
|
||||
ok(subscription.endpoint.startsWith('https://example.org/push'),
|
||||
'Wrong push endpoint in app subscription');
|
||||
ok(!subscription.isSystemSubscription,
|
||||
'Unexpected system subscription for app principal');
|
||||
equal(subscription.quota, 16, 'Wrong quota for app subscription');
|
||||
|
||||
do_test_finished();
|
||||
run_next_test();
|
||||
});
|
||||
});
|
||||
|
||||
add_test(function test_subscribe_origin_principal() {
|
||||
let scope = 'https://example.net/origin-principal';
|
||||
let principal =
|
||||
|
|
Загрузка…
Ссылка в новой задаче