Browse Source

import changes from `dev' branch of rmottola/Arctic-Fox:

- Bug 904479 - Added createPromiseWithId() that returns id of resolver r=kanru,nsm (2ac672d882)
- Bug 1166580 - Disable mozHasPendingMessage tests on non-browser platform. r=me (03c689964b)
- Bug 1162281 - Invalid system message handler in an App Manifest can break the entire system. r=fabrice (e192a95f9c)
- Bug 1198988 - Turn off some useless dump() calls r=ferjm (34fc83b236)
- Bug 1164498: Remove |DispatchBluetoothReply|, r=btian (6143335efa)
- Bug 1001757 - Add ability to store core apps outside of profile on desktop b2g; r=fabrice (f6b605e7aa)
- Bug 1155245 - Set the app status correctly for hosted certified apps in developer mode. r=fabrice (131178b80e)
- Bug 1179052 - Add some raptor markers to b2g gecko startup r=gwagner (222256fad8)
- Bug 1163904 - handle -url command line argument. r=fabrice (ee61af1ff9)
- Bug 1167275 - JS error in shell.js handleCmdLine() r=me (32e75c604f)
- Bug 1167197 - Fix GMPProvider on Android r=cpearce Bug 1181209 - Make changes to Gecko needed for b2gdroid to boot. r=fabrice (b35d3a372f)
- Bug 1158544 - Remove FTPChannelChild::mWasOpened and make the base class mWasOpened protected; r=mcmanus (9111e1bc00)
- Bug 1171716 - Part 2: Use NS_ReleaseOnMainThread in nsBaseChannel. r=froydnj (f138124f14)
- partial of Bug 1177175 - Add a UITour target inside the TP panel. (603cc719b3)
- Bug 1175545 - Dont process alt-svc on 421 r=hurley (ad0f2f6e91)
- Bug 1191291 - convert nsHttpChannel::RetargetDeliveryTo warning to log r=michal.novotny (b9c6003df8)
- Bug 1182487 - Don't try to write to HTTP cache entry in nsHttpChannel when entry is open for reading only. r=michal (b36d7014a0)
- Bug 1173069 - Don't accumulate the cache hit telemetry for intercepted channels; r=mayhemer,jdm (aaed79183d)
- Bug 1208755 HttpBaseChannel::ShouldIntercept() should not assume every channel has a LoadInfo. r=ckerschb (d55be94901)
- Bug 1201229 - Return an empty string for a header when an error occurs; r=dragana (256d0462c8)
- Bug 1048048 - add preload content policy types - web platform test updates (r=dveditz) (baa1004dd6)
- Bug 1048048 - add preload content policy types - csp changes (r=dveditz) (17914dadba)
- Bug 1048048 - add preload content policy types for stylesheets (r=cam) (29af13263a)
- Bug 1048048 - add preload content policy types (r=ehsan) (f58a32d51b)
- Bug 1201747 - Don't inspect the subject principal in StorageAllowedForPrincipal. r=mystor (4f2c100882)
- Bug 1176829 - Remove custom elements base element queue. r=smaug (03a520c13d)
- Bug 1176829 follow-up, finish removing unused member to fix bustage. CLOSED TREE (29c6150af8)
- Bug 1179909: Build fix. r=me CLOSED TREE (40e3bdb971)
- Bug 1188932 - Allow the User-Agent header to be explicitly set by requests, r=bkelly, r=jgraham (37aacbd37d)
master
roytam1 3 months ago
parent
commit
fe0509a62e
  1. 2
      b2g/chrome/content/settings.js
  2. 9
      b2g/chrome/content/shell.html
  3. 39
      b2g/chrome/content/shell.js
  4. 7
      b2g/components/B2GComponents.manifest
  5. 4
      b2g/components/CommandLine.js
  6. 26
      b2g/components/DirectoryProvider.js
  7. 10
      b2g/components/moz.build
  8. BIN
      build/pgo/certs/cert8.db
  9. BIN
      build/pgo/certs/key3.db
  10. 11
      build/pgo/server-locations.txt
  11. 4
      configure.in
  12. 64
      dom/apps/Webapps.js
  13. 67
      dom/apps/Webapps.jsm
  14. 11
      dom/base/DOMRequestHelper.jsm
  15. 75
      dom/base/nsContentPolicyUtils.h
  16. 40
      dom/base/nsContentUtils.cpp
  17. 63
      dom/base/nsDocument.cpp
  18. 8
      dom/base/nsDocument.h
  19. 2
      dom/base/nsIContentPolicy.idl
  20. 2
      dom/base/nsIContentPolicyBase.idl
  21. 8
      dom/base/test/file_explicit_user_agent.sjs
  22. 2
      dom/base/test/mochitest.ini
  23. 12
      dom/base/test/test_domrequesthelper.xul
  24. 65
      dom/base/test/test_explicit_user_agent.html
  25. 1
      dom/base/test/test_xhr_forbidden_headers.html
  26. 8
      dom/bluetooth/bluez/BluetoothDBusService.cpp
  27. 33
      dom/bluetooth/common/BluetoothUtils.cpp
  28. 9
      dom/bluetooth/common/BluetoothUtils.h
  29. 7
      dom/cache/DBSchema.cpp
  30. 22
      dom/engineeringmode/EngineeringModeAPI.js
  31. 7
      dom/fetch/InternalRequest.cpp
  32. 6
      dom/fetch/InternalRequest.h
  33. 17
      dom/inputmethod/MozKeyboard.js
  34. 65
      dom/messages/SystemMessageInternal.js
  35. 6
      dom/messages/interfaces/nsISystemMessagesInternal.idl
  36. 11
      dom/messages/test/chrome.ini
  37. 8
      dom/messages/test/invalid_manifest.webapp
  38. 1
      dom/messages/test/invalid_manifest.webapp^headers^
  39. 9
      dom/messages/test/manifest.webapp
  40. 1
      dom/messages/test/manifest.webapp^headers^
  41. 16
      dom/messages/test/test_hasPendingMessage.html
  42. 232
      dom/messages/test/test_sysmsg_registration.html
  43. 7
      dom/nfc/nsNfc.js
  44. 5
      dom/presentation/PresentationDeviceInfoManager.js
  45. 5
      dom/requestsync/RequestSyncManager.js
  46. 5
      dom/requestsync/RequestSyncScheduler.js
  47. 28
      dom/resourcestats/ResourceStatsManager.js
  48. 8
      dom/secureelement/DOMSecureElement.js
  49. 31
      dom/security/nsCSPContext.cpp
  50. 10
      dom/security/nsCSPService.cpp
  51. 9
      dom/security/test/cors/test_CrossSiteXHR.html
  52. 15
      dom/system/SystemUpdateManager.js
  53. 9
      dom/tests/mochitest/fetch/test_fetch_cors.js
  54. 156
      dom/tests/mochitest/fetch/test_headers_mainthread.html
  55. 3
      dom/tests/mochitest/general/frameStorageChrome.html
  56. 31
      dom/tests/mochitest/general/storagePermissionsUtils.js
  57. 4
      dom/tests/mochitest/general/test_storagePermissionsAccept.html
  58. 10
      dom/tests/mochitest/general/test_storagePermissionsLimitForeign.html
  59. 7
      dom/tests/mochitest/general/test_storagePermissionsReject.html
  60. 6
      dom/tests/mochitest/general/test_storagePermissionsRejectForeign.html
  61. 17
      dom/tethering/TetheringManager.js
  62. 2
      dom/xbl/nsXBLResourceLoader.cpp
  63. 6
      dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
  64. 2
      editor/libeditor/nsHTMLEditor.cpp
  65. 9
      hal/android/AndroidHal.cpp
  66. 46
      layout/style/Loader.cpp
  67. 11
      layout/style/Loader.h
  68. 2
      modules/libjar/nsJARChannel.cpp
  69. 11
      netwerk/base/nsBaseChannel.cpp
  70. 2
      netwerk/base/nsBaseChannel.h
  71. 1
      netwerk/protocol/ftp/FTPChannelChild.cpp
  72. 3
      netwerk/protocol/ftp/FTPChannelChild.h
  73. 6
      netwerk/protocol/http/HttpBaseChannel.cpp
  74. 2
      netwerk/protocol/http/NullHttpChannel.cpp
  75. 3
      netwerk/protocol/http/nsCORSListenerProxy.cpp
  76. 10
      netwerk/protocol/http/nsHttpChannel.cpp
  77. 5
      netwerk/protocol/viewsource/nsViewSourceChannel.cpp
  78. 2
      services/moz.build
  79. 5
      testing/web-platform/meta/content-security-policy/style-src/style-src-3_4.html.ini
  80. 2
      toolkit/devtools/server/actors/styleeditor.js
  81. 6
      toolkit/devtools/server/actors/stylesheets.js
  82. 77
      toolkit/mozapps/extensions/internal/GMPProvider.jsm
  83. 46
      toolkit/mozapps/extensions/test/xpcshell/test_gmpProvider.js

2
b2g/chrome/content/settings.js

@ -6,6 +6,8 @@
"use strict";
window.performance.mark('gecko-settings-loadstart');
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;

9
b2g/chrome/content/shell.html

@ -3,7 +3,7 @@
- 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/. -->
<html xmlns="http://www.w3.org/1999/xhtml "
<html xmlns="http://www.w3.org/1999/xhtml"
id="shell"
windowtype="navigator:browser"
#ifdef ANDROID
@ -16,13 +16,16 @@
#ifdef FXOS_SIMULATOR
<link rel="stylesheet" href="desktop.css" type="text/css">
#endif
<script type="text/javascript">
<!-- Add raptor performance marker -->
window.performance.mark('gecko-shell-html-load');
</script>
<script type="application/javascript;version=1.8"
src="chrome://b2g/content/settings.js"> </script>
<script type="application/javascript;version=1.8"
src="chrome://b2g/content/shell.js"> </script>
#ifndef MOZ_WIDGET_GONK
#ifndef ANDROID
<!-- various task that has to happen only on desktop -->
<script type="application/javascript;version=1.8"
src="chrome://b2g/content/desktop.js"> </script>

39
b2g/chrome/content/shell.js

@ -4,6 +4,8 @@
* 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/. */
window.performance.mark('gecko-shell-loadstart');
Cu.import('resource://gre/modules/ContactService.jsm');
Cu.import('resource://gre/modules/DataStoreChangeNotifier.jsm');
Cu.import('resource://gre/modules/AlarmService.jsm');
@ -73,6 +75,8 @@ XPCOMUtils.defineLazyServiceGetter(Services, 'captivePortalDetector',
'@mozilla.org/toolkit/captive-detector;1',
'nsICaptivePortalDetector');
window.performance.measure('gecko-shell-jsm-loaded', 'gecko-shell-loadstart');
function getContentWindow() {
return shell.contentBrowser.contentWindow;
}
@ -214,6 +218,12 @@ var shell = {
},
bootstrap: function() {
#ifdef MOZ_B2GDROID
Cc["@mozilla.org/b2g/b2gdroid-setup;1"]
.getService(Ci.nsIObserver).observe(window, "shell-startup", null);
#endif
window.performance.mark('gecko-shell-bootstrap');
let startManifestURL =
Cc['@mozilla.org/commandlinehandler/general-startup;1?type=b2gbootstrap']
.getService(Ci.nsISupports).wrappedJSObject.startManifestURL;
@ -228,6 +238,7 @@ var shell = {
},
start: function shell_start() {
window.performance.mark('gecko-shell-start');
this._started = true;
// This forces the initialization of the cookie service before we hit the
@ -347,6 +358,8 @@ var shell = {
this.contentBrowser.src = homeURL;
this.isHomeLoaded = false;
window.performance.mark('gecko-shell-system-frame-set');
ppmm.addMessageListener("content-handler", this);
ppmm.addMessageListener("dial-handler", this);
ppmm.addMessageListener("sms-handler", this);
@ -613,6 +626,7 @@ var shell = {
},
notifyContentStart: function shell_notifyContentStart() {
window.performance.mark('gecko-shell-notify-content-start');
this.contentBrowser.removeEventListener('mozbrowserloadstart', this, true);
this.contentBrowser.removeEventListener('mozbrowserlocationchange', this, true);
@ -650,7 +664,28 @@ var shell = {
}
delete shell.pendingChromeEvents;
});
}
shell.handleCmdLine();
},
handleCmdLine: function shell_handleCmdLine() {
// This isn't supported on devices.
#ifndef ANDROID
let b2gcmds = Cc["@mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds"]
.getService(Ci.nsISupports);
let args = b2gcmds.wrappedJSObject.cmdLine;
try {
// Returns null if -url is not present
let url = args.handleFlagWithParam("url", false);
if (url) {
this.sendChromeEvent({type: "mozbrowseropenwindow", url});
args.preventDefault = true;
}
} catch(e) {
// Throws if -url is present with no params
}
#endif
},
};
Services.obs.addObserver(function onFullscreenOriginChange(subject, topic, data) {
@ -905,6 +940,7 @@ window.addEventListener('ContentStart', function update_onContentStart() {
Cu.import('resource://gre/modules/WebappsUpdater.jsm');
WebappsUpdater.handleContentStart(shell);
#ifdef MOZ_UPDATER
let promptCc = Cc["@mozilla.org/updates/update-prompt;1"];
if (!promptCc) {
return;
@ -916,6 +952,7 @@ window.addEventListener('ContentStart', function update_onContentStart() {
}
updatePrompt.wrappedJSObject.handleContentStart(shell);
#endif
});
(function geolocationStatusTracker() {

7
b2g/components/B2GComponents.manifest

@ -16,10 +16,15 @@ contract @mozilla.org/updates/update-prompt;1 {88b3eb21-d072-4e3b-886d-f89d8c49f
category system-update-provider MozillaProvider @mozilla.org/updates/update-prompt;1,{88b3eb21-d072-4e3b-886d-f89d8c49fe59}
#endif
# On b2gdroid we want to use the android implementation of the directory service.
#ifndef MOZ_B2GDROID
#ifdef MOZ_B2G
# DirectoryProvider.js
component {9181eb7c-6f87-11e1-90b1-4f59d80dd2e5} DirectoryProvider.js
contract @mozilla.org/b2g/directory-provider;1 {9181eb7c-6f87-11e1-90b1-4f59d80dd2e5}
category xpcom-directory-providers b2g-directory-provider @mozilla.org/b2g/directory-provider;1
#endif
#endif
# ActivitiesGlue.js
component {3a54788b-48cc-4ab4-93d6-0d6a8ef74f8e} ActivitiesGlue.js
@ -87,6 +92,7 @@ contract @mozilla.org/fxaccounts/fxaccounts-ui-glue;1 {51875c14-91d7-4b8c-b65d-3
component {710322af-e6ae-4b0c-b2c9-1474a87b077e} HelperAppDialog.js
contract @mozilla.org/helperapplauncherdialog;1 {710322af-e6ae-4b0c-b2c9-1474a87b077e}
#ifndef MOZ_B2GDROID
#ifndef MOZ_WIDGET_GONK
component {c83c02c0-5d43-4e3e-987f-9173b313e880} SimulatorScreen.js
contract @mozilla.org/simulator-screen;1 {c83c02c0-5d43-4e3e-987f-9173b313e880}
@ -100,6 +106,7 @@ component {385993fe-8710-4621-9fb1-00a09d8bec37} CommandLine.js
contract @mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds {385993fe-8710-4621-9fb1-00a09d8bec37}
category command-line-handler m-b2gcmds @mozilla.org/commandlinehandler/general-startup;1?type=b2gcmds
#endif
#endif
# BootstrapCommandLine.js
component {fd663ec8-cf3f-4c2b-aacb-17a6915ccb44} BootstrapCommandLine.js

4
b2g/components/CommandLine.js

@ -15,6 +15,10 @@ function CommandlineHandler() {
CommandlineHandler.prototype = {
handle: function(cmdLine) {
this.cmdLine = cmdLine;
let win = Services.wm.getMostRecentWindow("navigator:browser");
if (win && win.shell) {
win.shell.handleCmdLine();
}
},
helpInfo: "",

26
b2g/components/DirectoryProvider.js

@ -15,6 +15,7 @@ const UPDATE_ARCHIVE_DIR = "UpdArchD"
const LOCAL_DIR = "/data/local";
const UPDATES_DIR = "updates/0";
const FOTA_DIR = "updates/fota";
const COREAPPSDIR_PREF = "b2g.coreappsdir"
XPCOMUtils.defineLazyServiceGetter(Services, "env",
"@mozilla.org/process/environment;1",
@ -97,12 +98,27 @@ DirectoryProvider.prototype = {
return this.getUpdateDir(persistent, FOTA_DIR, 1.1);
}
#else
// In desktop builds, coreAppsDir is the same as the profile directory.
// We just need to get the path from the parent, and it is then used to
// build jar:remoteopenfile:// uris.
// In desktop builds, coreAppsDir is the same as the profile
// directory unless otherwise specified. We just need to get the
// path from the parent, and it is then used to build
// jar:remoteopenfile:// uris.
if (prop == "coreAppsDir") {
let appsDir = Services.dirsvc.get("ProfD", Ci.nsIFile);
appsDir.append("webapps");
let coreAppsDirPref;
try {
coreAppsDirPref = Services.prefs.getCharPref(COREAPPSDIR_PREF);
} catch (e) {
// coreAppsDirPref may not exist if we're on an older version
// of gaia, so just fail silently.
}
let appsDir;
// If pref doesn't exist or isn't set, default to old value
if (!coreAppsDirPref || coreAppsDirPref == "") {
appsDir = Services.dirsvc.get("ProfD", Ci.nsIFile);
appsDir.append("webapps");
} else {
appsDir = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile)
appsDir.initWithPath(coreAppsDirPref);
}
persistent.value = true;
return appsDir;
} else if (prop == "ProfD") {

10
b2g/components/moz.build

@ -31,7 +31,7 @@ EXTRA_COMPONENTS += [
'WebappsUpdateTimer.js',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk' and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
EXTRA_COMPONENTS += [
'CommandLine.js',
'OopCommandLine.js',
@ -40,10 +40,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
EXTRA_PP_COMPONENTS += [
'B2GComponents.manifest',
'DirectoryProvider.js',
'RecoveryService.js',
]
if CONFIG['MOZ_B2G'] and not CONFIG['MOZ_B2GDROID']:
EXTRA_PP_COMPONENTS += [
'DirectoryProvider.js',
'RecoveryService.js',
]
if CONFIG['MOZ_UPDATER']:
EXTRA_PP_COMPONENTS += [
'UpdatePrompt.js',

BIN
build/pgo/certs/cert8.db

Binary file not shown.

BIN
build/pgo/certs/key3.db

Binary file not shown.

11
build/pgo/server-locations.txt

@ -95,10 +95,14 @@ http://example.net:80 privileged
# Used to test that clearing Service Workers for domain example.com, does not clear prefixexample.com
http://prefixexample.com:80
# The first HTTPS location is used to generate the Common Name (CN) value of the
# certificate's Issued To field.
https://example.com:443 privileged
https://example.org:443 privileged
https://test1.example.com:443 privileged
https://test2.example.com:443 privileged
https://example.org:443 privileged
https://test1.example.org:443 privileged
https://test2.example.org:443 privileged
https://sub1.test1.example.com:443 privileged
https://sub1.test2.example.com:443 privileged
https://sub2.test1.example.com:443 privileged
@ -168,6 +172,11 @@ http://tracking.example.com:80
http://not-tracking.example.com:80
http://tracking.example.org:80
https://malware.example.com:443
https://tracking.example.com:443
https://not-tracking.example.com:443
https://tracking.example.org:443
# Bug 483437, 484111
https://www.bank1.com:443 privileged,cert=escapeattack1

4
configure.in

@ -4003,6 +4003,10 @@ b2g/dev)
;;
esac
if test -n "$MOZ_B2GDROID"; then
AC_DEFINE(MOZ_B2GDROID)
fi
AC_SUBST(MOZ_BUILD_APP)
AC_SUBST(MOZ_PHOENIX)
AC_SUBST(MOZ_XULRUNNER)

64
dom/apps/Webapps.js

@ -316,7 +316,7 @@ WebappsRegistry.prototype = {
}
this.addMessageListeners(["Webapps:GetLocalizationResource:Return"]);
return this.createPromise((aResolve, aReject) => {
return this.createPromiseWithId((aResolverId) => {
cpmm.sendAsyncMessage("Webapps:GetLocalizationResource", {
manifestURL: manifestURL,
lang: aLanguage,
@ -325,10 +325,7 @@ WebappsRegistry.prototype = {
dataType: aType,
oid: this._id,
topId: this._topId,
requestID: this.getPromiseResolverId({
resolve: aResolve,
reject: aReject
})
requestID: aResolverId
});
});
},
@ -609,7 +606,7 @@ WebappsApplication.prototype = {
connect: function(aKeyword, aRules) {
this.addMessageListeners(["Webapps:Connect:Return:OK",
"Webapps:Connect:Return:KO"]);
return this.createPromise(function (aResolve, aReject) {
return this.createPromiseWithId((aResolverId) => {
let from = this._window.location.origin + this._window.location.pathname;
cpmm.sendAsyncMessage("Webapps:Connect", {
keyword: aKeyword,
@ -618,27 +615,21 @@ WebappsApplication.prototype = {
pubPageURL: from,
outerWindowID: this._id,
topWindowID: this._topId,
requestID: this.getPromiseResolverId({
resolve: aResolve,
reject: aReject
})
requestID: aResolverId
});
}.bind(this));
});
},
getConnections: function() {
this.addMessageListeners("Webapps:GetConnections:Return:OK");
return this.createPromise(function (aResolve, aReject) {
return this.createPromiseWithId((aResolverId) => {
cpmm.sendAsyncMessage("Webapps:GetConnections", {
manifestURL: this.manifestURL,
outerWindowID: this._id,
topWindowID: this._topId,
requestID: this.getPromiseResolverId({
resolve: aResolve,
reject: aReject
})
requestID: aResolverId
});
}.bind(this));
});
},
addReceipt: function(receipt) {
@ -689,22 +680,19 @@ WebappsApplication.prototype = {
export: function() {
this.addMessageListeners(["Webapps:Export:Return"]);
return this.createPromise((aResolve, aReject) => {
return this.createPromiseWithId((aResolverId) => {
cpmm.sendAsyncMessage("Webapps:Export",
{ manifestURL: this.manifestURL,
oid: this._id,
topId: this._topId,
requestID: this.getPromiseResolverId({
resolve: aResolve,
reject: aReject
})
requestID: aResolverId
});
});
},
getLocalizedValue: function(aProperty, aLang, aEntryPoint) {
this.addMessageListeners(["Webapps:GetLocalizedValue:Return"]);
return this.createPromise((aResolve, aReject) => {
return this.createPromiseWithId((aResolverId) => {
cpmm.sendAsyncMessage("Webapps:GetLocalizedValue",
{ manifestURL: this.manifestURL,
oid: this._id,
@ -712,10 +700,7 @@ WebappsApplication.prototype = {
property: aProperty,
lang: aLang,
entryPoint: aEntryPoint,
requestID: this.getPromiseResolverId({
resolve: aResolve,
reject: aReject
})
requestID: aResolverId
});
});
},
@ -958,19 +943,16 @@ WebappsApplicationMgmt.prototype = {
},
getIcon: function(aApp, aIconID, aEntryPoint) {
return this.createPromise(function(aResolve, aReject) {
return this.createPromiseWithId((aResolverId) => {
cpmm.sendAsyncMessage("Webapps:GetIcon", {
oid: this._id,
topId: this._topId,
manifestURL: aApp.manifestURL,
iconID: aIconID,
entryPoint: aEntryPoint,
requestID: this.getPromiseResolverId({
resolve: aResolve,
reject: aReject
})
requestID: aResolverId
});
}.bind(this));
});
},
getNotInstalled: function() {
@ -988,29 +970,25 @@ WebappsApplicationMgmt.prototype = {
import: function(aBlob) {
let principal = this._window.document.nodePrincipal;
return this.createPromise((aResolve, aReject) => {
return this.createPromiseWithId((aResolverId) => {
cpmm.sendAsyncMessage("Webapps:Import",
{ blob: aBlob,
oid: this._id,
topId: this._topId,
requestID: this.getPromiseResolverId({
resolve: aResolve,
reject: aReject
})}, null, principal);
requestID: aResolverId
}, null, principal);
});
},
extractManifest: function(aBlob) {
let principal = this._window.document.nodePrincipal;
return this.createPromise((aResolve, aReject) => {
return this.createPromiseWithId((aResolverId) => {
cpmm.sendAsyncMessage("Webapps:ExtractManifest",
{ blob: aBlob,
oid: this._id,
topId: this._topId,
requestID: this.getPromiseResolverId({
resolve: aResolve,
reject: aReject
})}, null, principal);
requestID: aResolverId
}, null, principal);
});
},

67
dom/apps/Webapps.jsm

@ -85,6 +85,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "Langpacks",
XPCOMUtils.defineLazyModuleGetter(this, "ImportExport",
"resource://gre/modules/ImportExport.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
"resource://gre/modules/AppConstants.jsm");
#ifdef MOZ_WIDGET_GONK
XPCOMUtils.defineLazyGetter(this, "libcutils", function() {
Cu.import("resource://gre/modules/systemlibs.js");
@ -774,9 +777,9 @@ this.DOMApplicationRegistry = {
}
}
#ifdef MOZ_WIDGET_GONK
yield this.installSystemApps();
#endif
if (AppConstants.MOZ_B2GDROID || AppConstants.MOZ_B2G) {
yield this.installSystemApps();
}
// At first run, install preloaded apps and set up their permissions.
for (let id in this.webapps) {
@ -851,8 +854,16 @@ this.DOMApplicationRegistry = {
root = aManifest.entry_points[aEntryPoint];
}
if (!root.messages || !Array.isArray(root.messages) ||
root.messages.length == 0) {
if (!root.messages) {
// This application just doesn't use system messages.
return;
}
if (!Array.isArray(root.messages) || root.messages.length == 0) {
dump("Could not register invalid system message entry for " + aApp.manifestURL + "\n");
try {
dump(JSON.stringify(root.messages) + "\n");
} catch(e) {}
return;
}
@ -862,27 +873,31 @@ this.DOMApplicationRegistry = {
root.messages.forEach(function registerPages(aMessage) {
let handlerPageURI = launchPathURI;
let messageName;
if (typeof(aMessage) === "object" && Object.keys(aMessage).length === 1) {
messageName = Object.keys(aMessage)[0];
let handlerPath = aMessage[messageName];
// Resolve the handler path from origin. If |handler_path| is absent,
// simply skip.
let fullHandlerPath;
if (typeof(aMessage) !== "object" || Object.keys(aMessage).length !== 1) {
dump("Could not register invalid system message entry for " + aApp.manifestURL + "\n");
try {
if (handlerPath && handlerPath.trim()) {
fullHandlerPath = manifest.resolveURL(handlerPath);
} else {
throw new Error("Empty or blank handler path.");
}
} catch(e) {
debug("system message handler path (" + handlerPath + ") is " +
"invalid, skipping. Error is: " + e);
return;
dump(JSON.stringify(aMessage) + "\n");
} catch(e) {}
return;
}
messageName = Object.keys(aMessage)[0];
let handlerPath = aMessage[messageName];
// Resolve the handler path from origin. If |handler_path| is absent,
// simply skip.
let fullHandlerPath;
try {
if (handlerPath && handlerPath.trim()) {
fullHandlerPath = manifest.resolveURL(handlerPath);
} else {
throw new Error("Empty or blank handler path.");
}
handlerPageURI = Services.io.newURI(fullHandlerPath, null, null);
} else {
messageName = aMessage;
} catch(e) {
debug("system message handler path (" + handlerPath + ") is " +
"invalid, skipping. Error is: " + e);
return;
}
handlerPageURI = Services.io.newURI(fullHandlerPath, null, null);
if (SystemMessagePermissionsChecker
.isSystemMessagePermittedToRegister(messageName,
@ -2939,6 +2954,12 @@ this.DOMApplicationRegistry = {
// don't update the permissions yet.
if (!aData.isPackage) {
if (supportUseCurrentProfile()) {
try {
if (Services.prefs.getBoolPref("dom.apps.developer_mode")) {
this.webapps[id].appStatus =
AppsUtils.getAppManifestStatus(app.manifest);
}
} catch(e) {};
PermissionsInstaller.installPermissions(
{
origin: appObject.origin,

11
dom/base/DOMRequestHelper.jsm

@ -298,6 +298,17 @@ DOMRequestIpcHelper.prototype = {
return new this._window.Promise(aPromiseInit);
},
/**
* createPromiseWithId() creates a new Promise, accepting a callback
* which is immediately called with the generated resolverId.
*/
createPromiseWithId: function(aCallback) {
return this.createPromise(function(aResolve, aReject) {
let resolverId = this.getPromiseResolverId({ resolve: aResolve, reject: aReject });
aCallback(resolverId);
}.bind(this));
},
forEachRequest: function(aCallback) {
if (!this._requests) {
return;

75
dom/base/nsContentPolicyUtils.h

@ -93,41 +93,46 @@ inline const char *
NS_CP_ContentTypeName(uint32_t contentType)
{
switch (contentType) {
CASE_RETURN( TYPE_OTHER );
CASE_RETURN( TYPE_SCRIPT );
CASE_RETURN( TYPE_IMAGE );
CASE_RETURN( TYPE_STYLESHEET );
CASE_RETURN( TYPE_OBJECT );
CASE_RETURN( TYPE_DOCUMENT );
CASE_RETURN( TYPE_SUBDOCUMENT );
CASE_RETURN( TYPE_REFRESH );
CASE_RETURN( TYPE_XBL );
CASE_RETURN( TYPE_PING );
CASE_RETURN( TYPE_XMLHTTPREQUEST );
CASE_RETURN( TYPE_OBJECT_SUBREQUEST );
CASE_RETURN( TYPE_DTD );
CASE_RETURN( TYPE_FONT );
CASE_RETURN( TYPE_MEDIA );
CASE_RETURN( TYPE_WEBSOCKET );
CASE_RETURN( TYPE_CSP_REPORT );
CASE_RETURN( TYPE_XSLT );
CASE_RETURN( TYPE_BEACON );
CASE_RETURN( TYPE_FETCH );
CASE_RETURN( TYPE_IMAGESET );
CASE_RETURN( TYPE_WEB_MANIFEST );
CASE_RETURN( TYPE_INTERNAL_SCRIPT );
CASE_RETURN( TYPE_INTERNAL_WORKER );
CASE_RETURN( TYPE_INTERNAL_SHARED_WORKER );
CASE_RETURN( TYPE_INTERNAL_EMBED );
CASE_RETURN( TYPE_INTERNAL_OBJECT );
CASE_RETURN( TYPE_INTERNAL_FRAME );
CASE_RETURN( TYPE_INTERNAL_IFRAME );
CASE_RETURN( TYPE_INTERNAL_AUDIO );
CASE_RETURN( TYPE_INTERNAL_VIDEO );
CASE_RETURN( TYPE_INTERNAL_TRACK );
CASE_RETURN( TYPE_INTERNAL_XMLHTTPREQUEST );
CASE_RETURN( TYPE_INTERNAL_EVENTSOURCE );
CASE_RETURN( TYPE_INTERNAL_SERVICE_WORKER );
CASE_RETURN( TYPE_OTHER );
CASE_RETURN( TYPE_SCRIPT );
CASE_RETURN( TYPE_IMAGE );
CASE_RETURN( TYPE_STYLESHEET );
CASE_RETURN( TYPE_OBJECT );
CASE_RETURN( TYPE_DOCUMENT );
CASE_RETURN( TYPE_SUBDOCUMENT );
CASE_RETURN( TYPE_REFRESH );
CASE_RETURN( TYPE_XBL );
CASE_RETURN( TYPE_PING );
CASE_RETURN( TYPE_XMLHTTPREQUEST );
CASE_RETURN( TYPE_OBJECT_SUBREQUEST );
CASE_RETURN( TYPE_DTD );
CASE_RETURN( TYPE_FONT );
CASE_RETURN( TYPE_MEDIA );
CASE_RETURN( TYPE_WEBSOCKET );
CASE_RETURN( TYPE_CSP_REPORT );
CASE_RETURN( TYPE_XSLT );
CASE_RETURN( TYPE_BEACON );
CASE_RETURN( TYPE_FETCH );
CASE_RETURN( TYPE_IMAGESET );
CASE_RETURN( TYPE_WEB_MANIFEST );
CASE_RETURN( TYPE_INTERNAL_SCRIPT );
CASE_RETURN( TYPE_INTERNAL_WORKER );
CASE_RETURN( TYPE_INTERNAL_SHARED_WORKER );
CASE_RETURN( TYPE_INTERNAL_EMBED );
CASE_RETURN( TYPE_INTERNAL_OBJECT );
CASE_RETURN( TYPE_INTERNAL_FRAME );
CASE_RETURN( TYPE_INTERNAL_IFRAME );
CASE_RETURN( TYPE_INTERNAL_AUDIO );
CASE_RETURN( TYPE_INTERNAL_VIDEO );
CASE_RETURN( TYPE_INTERNAL_TRACK );
CASE_RETURN( TYPE_INTERNAL_XMLHTTPREQUEST );
CASE_RETURN( TYPE_INTERNAL_EVENTSOURCE );
CASE_RETURN( TYPE_INTERNAL_SERVICE_WORKER );
CASE_RETURN( TYPE_INTERNAL_SCRIPT_PRELOAD );
CASE_RETURN( TYPE_INTERNAL_IMAGE );
CASE_RETURN( TYPE_INTERNAL_IMAGE_PRELOAD );
CASE_RETURN( TYPE_INTERNAL_STYLESHEET );
CASE_RETURN( TYPE_INTERNAL_STYLESHEET_PRELOAD );
default:
return "<Unknown Type>";
}

40
dom/base/nsContentUtils.cpp

@ -95,7 +95,6 @@
#include "nsHostObjectProtocolHandler.h"
#include "nsHtml5Module.h"
#include "nsHtml5StringParser.h"
#include "nsIAppShell.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsICategoryManager.h"
#include "nsIChannelEventSink.h"
@ -357,7 +356,6 @@ namespace {
static NS_DEFINE_CID(kParserServiceCID, NS_PARSERSERVICE_CID);
static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
static PLDHashTable* sEventListenerManagersHash;
@ -5266,7 +5264,6 @@ nsContentUtils::LeaveMicroTask()
MOZ_ASSERT(NS_IsMainThread());
if (--sMicroTaskLevel == 0) {
PerformMainThreadMicroTaskCheckpoint();
nsDocument::ProcessBaseElementQueue();
}
}
@ -7173,7 +7170,7 @@ nsContentUtils::IsForbiddenSystemRequestHeader(const nsACString& aHeader)
"access-control-request-method", "connection", "content-length",
"cookie", "cookie2", "content-transfer-encoding", "date", "dnt",
"expect", "host", "keep-alive", "origin", "referer", "te", "trailer",
"transfer-encoding", "upgrade", "user-agent", "via"
"transfer-encoding", "upgrade", "via"
};
for (uint32_t i = 0; i < ArrayLength(kInvalidHeaders); ++i) {
if (aHeader.LowerCaseEqualsASCII(kInvalidHeaders[i])) {
@ -7972,13 +7969,13 @@ nsContentUtils::GetWindowRoot(nsIDocument* aDoc)
return nullptr;
}
/* static */
nsContentPolicyType
nsContentUtils::InternalContentPolicyTypeToExternal(nsContentPolicyType aType)
{
switch (aType) {
case nsIContentPolicy::TYPE_INTERNAL_SCRIPT:
case nsIContentPolicy::TYPE_INTERNAL_SCRIPT_PRELOAD:
case nsIContentPolicy::TYPE_INTERNAL_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_SHARED_WORKER:
case nsIContentPolicy::TYPE_INTERNAL_SERVICE_WORKER:
@ -8001,6 +7998,14 @@ nsContentUtils::InternalContentPolicyTypeToExternal(nsContentPolicyType aType)
case nsIContentPolicy::TYPE_INTERNAL_EVENTSOURCE:
return nsIContentPolicy::TYPE_XMLHTTPREQUEST;
case nsIContentPolicy::TYPE_INTERNAL_IMAGE:
case nsIContentPolicy::TYPE_INTERNAL_IMAGE_PRELOAD:
return nsIContentPolicy::TYPE_IMAGE;
case nsIContentPolicy::TYPE_INTERNAL_STYLESHEET:
case nsIContentPolicy::TYPE_INTERNAL_STYLESHEET_PRELOAD:
return nsIContentPolicy::TYPE_STYLESHEET;
default:
return aType;
}
@ -8211,28 +8216,17 @@ nsContentUtils::InternalStorageAllowedForPrincipal(nsIPrincipal* aPrincipal,
access = std::min(StorageAccess::eSessionScoped, access);
}
// If the caller is chrome privileged, then it is allowed to access any
// storage it likes, no matter whether the storage for that window/principal
// would normally be permitted.
if (IsSystemPrincipal(SubjectPrincipal())) {
return access;
}
if (!SubjectPrincipal()->Subsumes(aPrincipal)) {
NS_WARNING("A principal is attempting to access storage for a principal "
"which it doesn't subsume!");
return StorageAccess::eDeny;
}
// About URIs are allowed to access storage, even if they don't have chrome
// privileges. If this is not desired, than the consumer will have to
// implement their own restriction functionality.
nsCOMPtr<nsIURI> uri;
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(aPrincipal->GetURI(getter_AddRefs(uri))));
bool isAbout = false;
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(uri->SchemeIs("about", &isAbout)));
if (isAbout) {
return access;
nsresult rv = aPrincipal->GetURI(getter_AddRefs(uri));
if (NS_SUCCEEDED(rv) && uri) {
bool isAbout = false;
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(uri->SchemeIs("about", &isAbout)));
if (isAbout) {
return access;
}
}
nsCOMPtr<nsIPermissionManager> permissionManager =

63
dom/base/nsDocument.cpp

@ -5915,29 +5915,6 @@ nsDocument::RegisterUnresolvedElement(Element* aElement, nsIAtom* aTypeName)
return NS_OK;
}
namespace {
class ProcessStackRunner final : public nsIRunnable
{
~ProcessStackRunner() {}
public:
explicit ProcessStackRunner(bool aIsBaseQueue = false)
: mIsBaseQueue(aIsBaseQueue)
{
}
NS_DECL_ISUPPORTS
NS_IMETHOD Run() override
{
nsDocument::ProcessTopElementQueue(mIsBaseQueue);
return NS_OK;
}
bool mIsBaseQueue;
};
NS_IMPL_ISUPPORTS(ProcessStackRunner, nsIRunnable);
} // namespace
void
nsDocument::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType aType,
Element* aCustomElement,
@ -6039,10 +6016,7 @@ nsDocument::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType aType,
// A new element queue needs to be pushed if the queue at the
// top of the stack is associated with another microtask level.
// Don't push a queue for the level 0 microtask (base element queue)
// because we don't want to process the queue until the
// microtask checkpoint.
bool shouldPushElementQueue = nsContentUtils::MicroTaskLevel() > 0 &&
bool shouldPushElementQueue =
(!lastData || lastData->mAssociatedMicroTask <
static_cast<int32_t>(nsContentUtils::MicroTaskLevel()));
@ -6065,39 +6039,22 @@ nsDocument::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType aType,
// should be invoked prior to returning control back to script.
// Create a script runner to process the top of the processing
// stack as soon as it is safe to run script.
nsContentUtils::AddScriptRunner(new ProcessStackRunner());
nsCOMPtr<nsIRunnable> runnable =
NS_NewRunnableFunction(&nsDocument::ProcessTopElementQueue);
nsContentUtils::AddScriptRunner(runnable);
}
}
}
// static
void
nsDocument::ProcessBaseElementQueue()
{
// Prevent re-entrance. Also, if a microtask checkpoint is reached
// and there is no processing stack to process, then we are done.
if (sProcessingBaseElementQueue || !sProcessingStack) {
return;
}
MOZ_ASSERT(nsContentUtils::MicroTaskLevel() == 0);
sProcessingBaseElementQueue = true;
nsContentUtils::AddScriptRunner(new ProcessStackRunner(true));
}
// static
void
nsDocument::ProcessTopElementQueue(bool aIsBaseQueue)
nsDocument::ProcessTopElementQueue()
{
MOZ_ASSERT(nsContentUtils::IsSafeToRunScript());
nsTArray<nsRefPtr<CustomElementData>>& stack = *sProcessingStack;
uint32_t firstQueue = stack.LastIndexOf((CustomElementData*) nullptr);
if (aIsBaseQueue && firstQueue != 0) {
return;
}
for (uint32_t i = firstQueue + 1; i < stack.Length(); ++i) {
// Callback queue may have already been processed in an earlier
// element queue or in an element queue that was popped
@ -6115,7 +6072,6 @@ nsDocument::ProcessTopElementQueue(bool aIsBaseQueue)
} else {
// Don't pop sentinel for base element queue.
stack.SetLength(1);
sProcessingBaseElementQueue = false;
}
}
@ -6131,10 +6087,6 @@ nsDocument::RegisterEnabled()
Maybe<nsTArray<nsRefPtr<mozilla::dom::CustomElementData>>>
nsDocument::sProcessingStack;
// static
bool
nsDocument::sProcessingBaseElementQueue;
void
nsDocument::RegisterElement(JSContext* aCx, const nsAString& aType,
const ElementRegistrationOptions& aOptions,
@ -8594,9 +8546,6 @@ nsDocument::RetrieveRelevantHeaders(nsIChannel *aChannel)
// The misspelled key 'referer' is as per the HTTP spec
rv = httpChannel->GetRequestHeader(NS_LITERAL_CSTRING("referer"),
mReferrer);
if (NS_FAILED(rv)) {
mReferrer.Truncate();
}
static const char *const headers[] = {
"default-style",
@ -9907,7 +9856,7 @@ nsDocument::PreloadStyle(nsIURI* uri, const nsAString& charset,
nsCOMPtr<nsICSSLoaderObserver> obs = new StubCSSLoaderObserver();
// Charset names are always ASCII.
CSSLoader()->LoadSheet(uri, NodePrincipal(),
CSSLoader()->LoadSheet(uri, true, NodePrincipal(),
NS_LossyConvertUTF16toASCII(charset),
obs,
Element::StringToCORSMode(aCrossOriginAttr),

8
dom/base/nsDocument.h

@ -1296,7 +1296,7 @@ public:
mozilla::dom::LifecycleCallbackArgs* aArgs = nullptr,
mozilla::dom::CustomElementDefinition* aDefinition = nullptr) override;
static void ProcessTopElementQueue(bool aIsBaseQueue = false);
static void ProcessTopElementQueue();
void GetCustomPrototype(int32_t aNamespaceID,
nsIAtom* aAtom,
@ -1584,15 +1584,9 @@ private:
// queue in the stack is the base element queue.
static mozilla::Maybe<nsTArray<nsRefPtr<mozilla::dom::CustomElementData>>> sProcessingStack;
// Flag to prevent re-entrance into base element queue as described in the
// custom elements speicification.
static bool sProcessingBaseElementQueue;
static bool CustomElementConstructor(JSContext* aCx, unsigned aArgc, JS::Value* aVp);
public:
static void ProcessBaseElementQueue();
// Enqueue created callback or register upgrade candidate for
// newly created custom elements, possibly extending an existing type.
// ex. <x-button>, <button is="x-button> (type extension)

2
dom/base/nsIContentPolicy.idl

@ -20,7 +20,7 @@ interface nsIPrincipal;
* by launching a dialog to prompt the user for something).
*/
[scriptable,uuid(ce321216-c404-40a7-a711-d80454ec6b76)]
[scriptable,uuid(caad4f1f-d047-46ac-ae9d-dc598e4fb91b)]
interface nsIContentPolicy : nsIContentPolicyBase
{
/**

2
dom/base/nsIContentPolicyBase.idl

@ -24,7 +24,7 @@ typedef unsigned long nsContentPolicyType;
* by launching a dialog to prompt the user for something).
*/
[scriptable,uuid(8527ae0d-0c43-4413-bc46-85c0bcb66876)]
[scriptable,uuid(17418187-d86f-48dd-92d1-238838df0a4e)]
interface nsIContentPolicyBase : nsISupports
{
/**

8
dom/base/test/file_explicit_user_agent.sjs

@ -0,0 +1,8 @@
function handleRequest(request, response)
{
if (request.hasHeader("User-Agent")) {
response.setHeader("Result-User-Agent",
request.getHeader("User-Agent"));
}
response.write("");
}

2
dom/base/test/mochitest.ini

@ -250,6 +250,7 @@ support-files =
iframe_postMessages.html
test_performance_observer.js
performance_observer.html
file_explicit_user_agent.sjs
[test_anonymousContent_api.html]
[test_anonymousContent_append_after_reflow.html]
@ -818,3 +819,4 @@ support-files = worker_postMessages.js
[test_window_proto.html]
[test_frameLoader_switchProcess.html]
skip-if = e10s || os != 'linux' || buildapp != 'browser'
[test_explicit_user_agent.html]

12
dom/base/test/test_domrequesthelper.xul

@ -400,6 +400,18 @@
ok(promise instanceof Promise, "Returned a Promise");
promise.then(next);
},
function() {
info("== Test createPromiseWithId()");
var _resolverId;
var promise = dummy.createPromiseWithId(function(resolverId) {
_resolverId = resolverId;
});
var resolver = dummy.getPromiseResolver(_resolverId);
ok(promise instanceof Promise, "Returned a Promise");
ok(typeof _resolverId === "string", "resolverId is a string");
ok(resolver != null, "resolverId is a valid id");
next();
},
function() {
info("== Test getResolver()");
var id;

65
dom/base/test/test_explicit_user_agent.html

@ -0,0 +1,65 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for XMLHttpRequest.GetResponseHeader(foo) byte-inflates the output</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<meta charset="utf-8">
</head>
<body>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script class="testbody" type="application/javascript;version=1.7">
"use strict";
add_task(function*() {
yield new Promise((r) => {
let xhr = new XMLHttpRequest();
xhr.open('GET', 'file_explicit_user_agent.sjs', true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
is(xhr.getResponseHeader("Result-User-Agent"), navigator.userAgent,
"The resulting user-agent is the navigator's UA");
r();
}
}
xhr.send(null);
});
yield new Promise((r) => {
let xhr = new XMLHttpRequest();
xhr.open('GET', 'file_explicit_user_agent.sjs', true);
xhr.setRequestHeader('User-Agent', 'custom-ua/10.0');
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
is(xhr.getResponseHeader("Result-User-Agent"), 'custom-ua/10.0',
"The resulting user-agent is the custom UA");
r();
}
}
xhr.send(null);
});
var response = yield fetch('file_explicit_user_agent.sjs', {
method: 'GET'
});
is(response.headers.get("Result-User-Agent"), navigator.userAgent,
"The user-agent is the navigator's UA");
var headers = new Headers();
headers.set('User-Agent', 'custom-ua/20.0');
var response2 = yield fetch('file_explicit_user_agent.sjs', {
method: 'GET',
headers: headers,
});
is(response2.headers.get("Result-User-Agent"), 'custom-ua/20.0',
"The user-agent is the custom UA");
});
</script>
</pre>
</body>
</html>

1
dom/base/test/test_xhr_forbidden_headers.html

@ -40,7 +40,6 @@ var headers = [
"trAiLer",
"trANsfEr-eNcoDiNg",
"uPGraDe",
"user-AGENT",
"viA",
"pRoxy-",
"sEc-",

8
dom/bluetooth/bluez/BluetoothDBusService.cpp

@ -411,7 +411,6 @@ DispatchToBtThread(nsIRunnable* aRunnable)
return sBluetoothThread->Dispatch(aRunnable, NS_DISPATCH_NORMAL);
}
#ifdef MOZ_B2G_BT_API_V2
static void
DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,
const BluetoothValue& aValue,
@ -423,9 +422,6 @@ DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,
DispatchReplySuccess(aRunnable, aValue);
}
}
#else
// Missing in bluetooth1
#endif
BluetoothDBusService::BluetoothDBusService()
{
@ -4275,14 +4271,14 @@ BluetoothDBusService::UpdateNotification(ControlEventId aEventId,
void
BluetoothDBusService::StartLeScanInternal(
const nsTArray<nsString>& aServiceUuids,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable)
{
}
void
BluetoothDBusService::StopLeScanInternal(
const nsAString& aAppUuid,
BluetoothReplyRunnable* aRunnable);
BluetoothReplyRunnable* aRunnable)
{
}

33
dom/bluetooth/common/BluetoothUtils.cpp

@ -221,8 +221,10 @@ BroadcastSystemMessage(const nsAString& aType,
return false;
}
nsCOMPtr<nsISupports> promise;
systemMessenger->BroadcastMessage(aType, value,
JS::UndefinedHandleValue);
JS::UndefinedHandleValue,
getter_AddRefs(promise));
return true;
}
@ -251,8 +253,10 @@ BroadcastSystemMessage(const nsAString& aType,
NS_ENSURE_TRUE(systemMessenger, false);
JS::Rooted<JS::Value> value(cx, JS::ObjectValue(*obj));
nsCOMPtr<nsISupports> promise;
systemMessenger->BroadcastMessage(aType, value,
JS::UndefinedHandleValue);
JS::UndefinedHandleValue,
getter_AddRefs(promise));
return true;
}
@ -306,31 +310,6 @@ DispatchReplyError(BluetoothReplyRunnable* aRunnable,
NS_WARN_IF(NS_FAILED(NS_DispatchToMainThread(aRunnable)));
}
#if MOZ_B2G_BT_API_V2
// TODO: remove with bluetooth1
#else
void
DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,
const BluetoothValue& aValue,
const nsAString& aErrorStr)
{
// Reply will be deleted by the runnable after running on main thread
BluetoothReply* reply;
if (!aErrorStr.IsEmpty()) {
nsString err(aErrorStr);
reply = new BluetoothReply(BluetoothReplyError(err));
} else {
MOZ_ASSERT(aValue.type() != BluetoothValue::T__None);
reply = new BluetoothReply(BluetoothReplySuccess(aValue));
}
aRunnable->SetReply(reply);
if (NS_FAILED(NS_DispatchToMainThread(aRunnable))) {
BT_WARNING("Failed to dispatch to main thread!");
}
}
#endif
void
DispatchStatusChangedEvent(const nsAString& aType,
const nsAString& aAddress,

9
dom/bluetooth/common/BluetoothUtils.h

@ -161,15 +161,6 @@ void
DispatchReplyError(BluetoothReplyRunnable* aRunnable,
const enum BluetoothStatus aStatus);
#if MOZ_B2G_BT_API_V2
// TODO: remove with bluetooth1
#else
void
DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,
const BluetoothValue& aValue,
const nsAString& aErrorStr);
#endif
void
DispatchStatusChangedEvent(const nsAString& aType,
const nsAString& aDeviceAddress,

7
dom/cache/DBSchema.cpp vendored

@ -275,7 +275,12 @@ static_assert(nsIContentPolicy::TYPE_INVALID == 0 &&
nsIContentPolicy::TYPE_INTERNAL_TRACK == 32 &&
nsIContentPolicy::TYPE_INTERNAL_XMLHTTPREQUEST == 33 &&
nsIContentPolicy::TYPE_INTERNAL_EVENTSOURCE == 34 &&