Bug 1238723 - Tab child needs to use default user context id when handling permissions. r=sicking
authorDave Huseby <dhuseby@mozilla.com>
Fri, 01 Apr 2016 16:49:00 -0400
changeset 291477 a28d0f76c03b1b6c823ac0bfdd99462dcf2962e9
parent 291456 df803eb33993cc01ad0c43740a9e2a97fd976020
child 291478 8038df809897f0780cc4d585241fbef79d555b5f
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs1238723
milestone48.0a1
Bug 1238723 - Tab child needs to use default user context id when handling permissions. r=sicking
dom/ipc/ContentChild.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -2487,16 +2487,20 @@ ContentChild::RecvAddPermission(const IP
   nsPermissionManager* permissionManager =
     static_cast<nsPermissionManager*>(permissionManagerIface.get());
   MOZ_ASSERT(permissionManager,
          "We have no permissionManager in the Content process !");
 
   nsAutoCString originNoSuffix;
   PrincipalOriginAttributes attrs;
   attrs.PopulateFromOrigin(permission.origin, originNoSuffix);
+  // we're doing this because we currently don't support isolating permissions
+  // by userContextId.
+  MOZ_ASSERT(attrs.mUserContextId == nsIScriptSecurityManager::DEFAULT_USER_CONTEXT_ID,
+      "permission user context should be set to default!");
 
   nsCOMPtr<nsIURI> uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), originNoSuffix);
   NS_ENSURE_SUCCESS(rv, true);
 
   nsCOMPtr<nsIPrincipal> principal = mozilla::BasePrincipal::CreateCodebasePrincipal(uri, attrs);
 
   // child processes don't care about modification time.