Bug 1547397 - Part 3: Move the permission manager code to extensions/permissions; r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 30 Apr 2019 14:06:53 +0000
changeset 530767 f3c896ea6e1693af54eb6515aad514869d68f057
parent 530766 f6a701d4a8986f310c5867540a5cf5b60ed5dcea
child 530768 19bf83121d3138bfd7718e93ce8b05e478b079b7
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1547397
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1547397 - Part 3: Move the permission manager code to extensions/permissions; r=baku Differential Revision: https://phabricator.services.mozilla.com/D29116
.eslintignore
dom/ipc/moz.build
dom/permission/moz.build
extensions/cookie/components.conf
extensions/cookie/moz.build
extensions/cookie/nsPermission.cpp
extensions/cookie/nsPermission.h
extensions/cookie/nsPermissionManager.cpp
extensions/cookie/nsPermissionManager.h
extensions/cookie/test/.eslintrc.js
extensions/cookie/test/browser.ini
extensions/cookie/test/browser_permmgr_sync.js
extensions/cookie/test/browser_permmgr_viewsrc.js
extensions/cookie/test/gtest/PermissionManagerTest.cpp
extensions/cookie/test/gtest/moz.build
extensions/cookie/test/moz.build
extensions/cookie/test/unit/test_permmanager_cleardata.js
extensions/cookie/test/unit/test_permmanager_default_pref.js
extensions/cookie/test/unit/test_permmanager_defaults.js
extensions/cookie/test/unit/test_permmanager_expiration.js
extensions/cookie/test/unit/test_permmanager_getAllForURI.js
extensions/cookie/test/unit/test_permmanager_getAllWithTypePrefix.js
extensions/cookie/test/unit/test_permmanager_getPermissionObject.js
extensions/cookie/test/unit/test_permmanager_idn.js
extensions/cookie/test/unit/test_permmanager_load_invalid_entries.js
extensions/cookie/test/unit/test_permmanager_local_files.js
extensions/cookie/test/unit/test_permmanager_matches.js
extensions/cookie/test/unit/test_permmanager_matchesuri.js
extensions/cookie/test/unit/test_permmanager_migrate_4-7.js
extensions/cookie/test/unit/test_permmanager_migrate_4-7_no_history.js
extensions/cookie/test/unit/test_permmanager_migrate_5-7a.js
extensions/cookie/test/unit/test_permmanager_migrate_5-7b.js
extensions/cookie/test/unit/test_permmanager_migrate_6-7a.js
extensions/cookie/test/unit/test_permmanager_migrate_6-7b.js
extensions/cookie/test/unit/test_permmanager_migrate_7-8.js
extensions/cookie/test/unit/test_permmanager_notifications.js
extensions/cookie/test/unit/test_permmanager_removeall.js
extensions/cookie/test/unit/test_permmanager_removebytype.js
extensions/cookie/test/unit/test_permmanager_removebytypesince.js
extensions/cookie/test/unit/test_permmanager_removeforapp.js
extensions/cookie/test/unit/test_permmanager_removepermission.js
extensions/cookie/test/unit/test_permmanager_removesince.js
extensions/cookie/test/unit/test_permmanager_subdomains.js
extensions/cookie/test/unit/xpcshell.ini
extensions/permissions/components.conf
extensions/permissions/moz.build
extensions/permissions/nsPermission.cpp
extensions/permissions/nsPermission.h
extensions/permissions/nsPermissionManager.cpp
extensions/permissions/nsPermissionManager.h
extensions/permissions/test/.eslintrc.js
extensions/permissions/test/browser.ini
extensions/permissions/test/browser_permmgr_sync.js
extensions/permissions/test/browser_permmgr_viewsrc.js
extensions/permissions/test/gtest/PermissionManagerTest.cpp
extensions/permissions/test/gtest/moz.build
extensions/permissions/test/moz.build
extensions/permissions/test/unit/test_permmanager_cleardata.js
extensions/permissions/test/unit/test_permmanager_default_pref.js
extensions/permissions/test/unit/test_permmanager_defaults.js
extensions/permissions/test/unit/test_permmanager_expiration.js
extensions/permissions/test/unit/test_permmanager_getAllForURI.js
extensions/permissions/test/unit/test_permmanager_getAllWithTypePrefix.js
extensions/permissions/test/unit/test_permmanager_getPermissionObject.js
extensions/permissions/test/unit/test_permmanager_idn.js
extensions/permissions/test/unit/test_permmanager_load_invalid_entries.js
extensions/permissions/test/unit/test_permmanager_local_files.js
extensions/permissions/test/unit/test_permmanager_matches.js
extensions/permissions/test/unit/test_permmanager_matchesuri.js
extensions/permissions/test/unit/test_permmanager_migrate_4-7.js
extensions/permissions/test/unit/test_permmanager_migrate_4-7_no_history.js
extensions/permissions/test/unit/test_permmanager_migrate_5-7a.js
extensions/permissions/test/unit/test_permmanager_migrate_5-7b.js
extensions/permissions/test/unit/test_permmanager_migrate_6-7a.js
extensions/permissions/test/unit/test_permmanager_migrate_6-7b.js
extensions/permissions/test/unit/test_permmanager_migrate_7-8.js
extensions/permissions/test/unit/test_permmanager_notifications.js
extensions/permissions/test/unit/test_permmanager_removeall.js
extensions/permissions/test/unit/test_permmanager_removebytype.js
extensions/permissions/test/unit/test_permmanager_removebytypesince.js
extensions/permissions/test/unit/test_permmanager_removeforapp.js
extensions/permissions/test/unit/test_permmanager_removepermission.js
extensions/permissions/test/unit/test_permmanager_removesince.js
extensions/permissions/test/unit/test_permmanager_subdomains.js
extensions/permissions/test/unit/xpcshell.ini
layout/build/moz.build
netwerk/cookie/moz.build
toolkit/components/antitracking/moz.build
toolkit/toolkit.mozbuild
--- a/.eslintignore
+++ b/.eslintignore
@@ -9,17 +9,17 @@
 **/reftests/**
 
 # Exclude expected objdirs.
 obj*/**
 
 # We ignore all these directories by default, until we get them enabled.
 # If you are enabling a directory, please add directory specific exclusions
 # below.
-extensions/cookie/**
+extensions/permissions/**
 extensions/spellcheck/**
 extensions/universalchardet/**
 image/**
 layout/**
 netwerk/cookie/test/browser/**
 netwerk/test/browser/**
 netwerk/test/mochitests/**
 netwerk/test/unit*/**
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -156,17 +156,17 @@ LOCAL_INCLUDES += [
     '/dom/base',
     '/dom/bindings',
     '/dom/events',
     '/dom/filesystem',
     '/dom/geolocation',
     '/dom/media/webspeech/synth/ipc',
     '/dom/security',
     '/dom/storage',
-    '/extensions/cookie',
+    '/extensions/permissions',
     '/extensions/spellcheck/src',
     '/gfx/2d',
     '/hal/sandbox',
     '/js/xpconnect/loader',
     '/js/xpconnect/src',
     '/layout/base',
     '/media/webrtc',
     '/netwerk/base',
--- a/dom/permission/moz.build
+++ b/dom/permission/moz.build
@@ -15,16 +15,16 @@ EXPORTS.mozilla.dom += [
 UNIFIED_SOURCES += [
     'PermissionObserver.cpp',
     'Permissions.cpp',
     'PermissionStatus.cpp',
     'PermissionUtils.cpp',
 ]
 
 LOCAL_INCLUDES += [
-    '/extensions/cookie',
+    '/extensions/permissions',
 ]
 
 MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
 
 FINAL_LIBRARY = 'xul'
 
 include('/ipc/chromium/chromium-config.mozbuild')
deleted file mode 100644
--- a/extensions/cookie/components.conf
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Classes = [
-    {
-        'cid': '{4f6b5e00-0c36-11d5-a535-0010a401eb10}',
-        'contract_ids': ['@mozilla.org/permissionmanager;1'],
-        'singleton': True,
-        'type': 'nsIPermissionManager',
-        'constructor': 'nsPermissionManager::GetXPCOMSingleton',
-        'headers': ['/extensions/cookie/nsPermissionManager.h'],
-    },
-]
deleted file mode 100644
--- a/extensions/cookie/moz.build
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-TEST_DIRS += ['test']
-
-UNIFIED_SOURCES += [
-    'nsPermission.cpp',
-    'nsPermissionManager.cpp',
-]
-
-XPCOM_MANIFESTS += [
-    'components.conf',
-]
-
-LOCAL_INCLUDES += [
-    '/caps',
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
-
-if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
-    CXXFLAGS += ['-Wno-error=shadow']
-
-with Files('**'):
-    BUG_COMPONENT = ('Core', 'Networking: Cookies')
--- a/extensions/permissions/components.conf
+++ b/extensions/permissions/components.conf
@@ -8,9 +8,17 @@ Classes = [
     {
         'cid': '{4ca6b67b-5cc7-4e71-a98a-97af1c134862}',
         'contract_ids': ['@mozilla.org/permissions/contentblocker;1'],
         'type': 'nsContentBlocker',
         'headers': ['/extensions/permissions/nsContentBlocker.h'],
         'init_method': 'Init',
         'categories': {'content-policy': '@mozilla.org/permissions/contentblocker;1'},
     },
+    {
+        'cid': '{4f6b5e00-0c36-11d5-a535-0010a401eb10}',
+        'contract_ids': ['@mozilla.org/permissionmanager;1'],
+        'singleton': True,
+        'type': 'nsIPermissionManager',
+        'constructor': 'nsPermissionManager::GetXPCOMSingleton',
+        'headers': ['/extensions/permissions/nsPermissionManager.h'],
+    },
 ]
--- a/extensions/permissions/moz.build
+++ b/extensions/permissions/moz.build
@@ -1,18 +1,31 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+TEST_DIRS += ['test']
+
 UNIFIED_SOURCES += [
     'nsContentBlocker.cpp',
+    'nsPermission.cpp',
+    'nsPermissionManager.cpp',
 ]
 
 XPCOM_MANIFESTS += [
     'components.conf',
 ]
 
+LOCAL_INCLUDES += [
+    '/caps',
+]
+
+include('/ipc/chromium/chromium-config.mozbuild')
+
 FINAL_LIBRARY = 'xul'
 
+if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
+    CXXFLAGS += ['-Wno-error=shadow']
+
 with Files('**'):
-    BUG_COMPONENT = ('Core', 'DOM: Core & HTML')
+    BUG_COMPONENT = ('Core', 'Permission Manager')
rename from extensions/cookie/nsPermission.cpp
rename to extensions/permissions/nsPermission.cpp
rename from extensions/cookie/nsPermission.h
rename to extensions/permissions/nsPermission.h
rename from extensions/cookie/nsPermissionManager.cpp
rename to extensions/permissions/nsPermissionManager.cpp
rename from extensions/cookie/nsPermissionManager.h
rename to extensions/permissions/nsPermissionManager.h
rename from extensions/cookie/test/.eslintrc.js
rename to extensions/permissions/test/.eslintrc.js
rename from extensions/cookie/test/browser.ini
rename to extensions/permissions/test/browser.ini
rename from extensions/cookie/test/browser_permmgr_sync.js
rename to extensions/permissions/test/browser_permmgr_sync.js
rename from extensions/cookie/test/browser_permmgr_viewsrc.js
rename to extensions/permissions/test/browser_permmgr_viewsrc.js
rename from extensions/cookie/test/gtest/PermissionManagerTest.cpp
rename to extensions/permissions/test/gtest/PermissionManagerTest.cpp
rename from extensions/cookie/test/gtest/moz.build
rename to extensions/permissions/test/gtest/moz.build
--- a/extensions/cookie/test/gtest/moz.build
+++ b/extensions/permissions/test/gtest/moz.build
@@ -4,13 +4,13 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 UNIFIED_SOURCES += [
     'PermissionManagerTest.cpp',
 ]
 
 LOCAL_INCLUDES += [
-    '/extensions/cookie',
+    '/extensions/permissions',
 ]
 
 FINAL_LIBRARY = 'xul-gtest'
 
rename from extensions/cookie/test/moz.build
rename to extensions/permissions/test/moz.build
rename from extensions/cookie/test/unit/test_permmanager_cleardata.js
rename to extensions/permissions/test/unit/test_permmanager_cleardata.js
rename from extensions/cookie/test/unit/test_permmanager_default_pref.js
rename to extensions/permissions/test/unit/test_permmanager_default_pref.js
rename from extensions/cookie/test/unit/test_permmanager_defaults.js
rename to extensions/permissions/test/unit/test_permmanager_defaults.js
rename from extensions/cookie/test/unit/test_permmanager_expiration.js
rename to extensions/permissions/test/unit/test_permmanager_expiration.js
rename from extensions/cookie/test/unit/test_permmanager_getAllForURI.js
rename to extensions/permissions/test/unit/test_permmanager_getAllForURI.js
rename from extensions/cookie/test/unit/test_permmanager_getAllWithTypePrefix.js
rename to extensions/permissions/test/unit/test_permmanager_getAllWithTypePrefix.js
rename from extensions/cookie/test/unit/test_permmanager_getPermissionObject.js
rename to extensions/permissions/test/unit/test_permmanager_getPermissionObject.js
rename from extensions/cookie/test/unit/test_permmanager_idn.js
rename to extensions/permissions/test/unit/test_permmanager_idn.js
rename from extensions/cookie/test/unit/test_permmanager_load_invalid_entries.js
rename to extensions/permissions/test/unit/test_permmanager_load_invalid_entries.js
rename from extensions/cookie/test/unit/test_permmanager_local_files.js
rename to extensions/permissions/test/unit/test_permmanager_local_files.js
rename from extensions/cookie/test/unit/test_permmanager_matches.js
rename to extensions/permissions/test/unit/test_permmanager_matches.js
rename from extensions/cookie/test/unit/test_permmanager_matchesuri.js
rename to extensions/permissions/test/unit/test_permmanager_matchesuri.js
rename from extensions/cookie/test/unit/test_permmanager_migrate_4-7.js
rename to extensions/permissions/test/unit/test_permmanager_migrate_4-7.js
rename from extensions/cookie/test/unit/test_permmanager_migrate_4-7_no_history.js
rename to extensions/permissions/test/unit/test_permmanager_migrate_4-7_no_history.js
rename from extensions/cookie/test/unit/test_permmanager_migrate_5-7a.js
rename to extensions/permissions/test/unit/test_permmanager_migrate_5-7a.js
rename from extensions/cookie/test/unit/test_permmanager_migrate_5-7b.js
rename to extensions/permissions/test/unit/test_permmanager_migrate_5-7b.js
rename from extensions/cookie/test/unit/test_permmanager_migrate_6-7a.js
rename to extensions/permissions/test/unit/test_permmanager_migrate_6-7a.js
rename from extensions/cookie/test/unit/test_permmanager_migrate_6-7b.js
rename to extensions/permissions/test/unit/test_permmanager_migrate_6-7b.js
rename from extensions/cookie/test/unit/test_permmanager_migrate_7-8.js
rename to extensions/permissions/test/unit/test_permmanager_migrate_7-8.js
rename from extensions/cookie/test/unit/test_permmanager_notifications.js
rename to extensions/permissions/test/unit/test_permmanager_notifications.js
rename from extensions/cookie/test/unit/test_permmanager_removeall.js
rename to extensions/permissions/test/unit/test_permmanager_removeall.js
rename from extensions/cookie/test/unit/test_permmanager_removebytype.js
rename to extensions/permissions/test/unit/test_permmanager_removebytype.js
rename from extensions/cookie/test/unit/test_permmanager_removebytypesince.js
rename to extensions/permissions/test/unit/test_permmanager_removebytypesince.js
rename from extensions/cookie/test/unit/test_permmanager_removeforapp.js
rename to extensions/permissions/test/unit/test_permmanager_removeforapp.js
rename from extensions/cookie/test/unit/test_permmanager_removepermission.js
rename to extensions/permissions/test/unit/test_permmanager_removepermission.js
rename from extensions/cookie/test/unit/test_permmanager_removesince.js
rename to extensions/permissions/test/unit/test_permmanager_removesince.js
rename from extensions/cookie/test/unit/test_permmanager_subdomains.js
rename to extensions/permissions/test/unit/test_permmanager_subdomains.js
rename from extensions/cookie/test/unit/xpcshell.ini
rename to extensions/permissions/test/unit/xpcshell.ini
--- a/layout/build/moz.build
+++ b/layout/build/moz.build
@@ -44,17 +44,17 @@ LOCAL_INCLUDES += [
     '/dom/svg',
     '/dom/xbl',
     '/dom/xslt/base',
     '/dom/xslt/xml',
     '/dom/xslt/xpath',
     '/dom/xslt/xslt',
     '/dom/xul',
     '/editor/composer',
-    '/extensions/cookie',
+    '/extensions/permissions',
     '/js/xpconnect/loader',
     '/js/xpconnect/src',
     '/netwerk/base',
     '/netwerk/cookie',
     '/view',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
--- a/netwerk/cookie/moz.build
+++ b/netwerk/cookie/moz.build
@@ -38,17 +38,17 @@ if CONFIG['NECKO_COOKIES']:
         'nsCookiePermission.cpp',
     ]
     # nsCookieService.cpp can't be unified because of symbol conflicts
     SOURCES += [
         'nsCookieService.cpp',
     ]
     LOCAL_INCLUDES += [
         '/dom/base',
-        '/extensions/cookie',
+        '/extensions/permissions',
         '/intl/uconv',
     ]
 
     XPCSHELL_TESTS_MANIFESTS += [
         'test/unit/xpcshell.ini',
     ]
 
     BROWSER_CHROME_MANIFESTS += [
--- a/toolkit/components/antitracking/moz.build
+++ b/toolkit/components/antitracking/moz.build
@@ -13,16 +13,16 @@ EXPORTS.mozilla = [
 ]
 
 UNIFIED_SOURCES += [
     'AntiTrackingCommon.cpp',
     'StoragePrincipalHelper.cpp',
 ]
 
 LOCAL_INCLUDES += [
-    '/extensions/cookie',
+    '/extensions/permissions',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -82,17 +82,16 @@ DIRS += [
 ]
 
 if CONFIG['COMPILE_ENVIRONMENT']:
     DIRS += [
         '/media/libyuv',
     ]
 
 DIRS += [
-    '/extensions/cookie',
     '/extensions/permissions',
 ]
 
 if CONFIG['MOZ_WEBRTC'] and CONFIG['COMPILE_ENVIRONMENT']:
     DIRS += [
         '/media/webrtc',
         '/media/mtransport',
     ]