Backed out changeset 6a3a0e3bfaf6 (bug 1054671) for B2G emulator build bustage on CLOSED TREE
authorNigel Babu <nigelbabu@gmail.com>
Tue, 16 Dec 2014 11:24:15 +0530
changeset 219820 29ed7a01c8159ded4d93d90c980c80756153712b
parent 219819 b50f7347bb974067aedf766da4f2ce6b55ed63a0
child 219821 78a5cadec4fc9d91ae6c6ae2080531b7e06dd963
push id52935
push usernigelbabu@gmail.com
push dateTue, 16 Dec 2014 05:54:49 +0000
treeherdermozilla-inbound@29ed7a01c815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1054671
milestone37.0a1
backs out6a3a0e3bfaf61160e0b415fbdc4b739b781e6554
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
Backed out changeset 6a3a0e3bfaf6 (bug 1054671) for B2G emulator build bustage on CLOSED TREE
dom/base/Console.cpp
dom/base/MessagePort.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsJSEnvironment.cpp
dom/bluetooth/bluedroid/BluetoothA2dpHALInterface.cpp
dom/bluetooth/bluedroid/BluetoothAvrcpHALInterface.cpp
dom/bluetooth/bluedroid/BluetoothHALInterface.cpp
dom/bluetooth/bluedroid/BluetoothHandsfreeHALInterface.cpp
dom/bluetooth2/bluedroid/BluetoothA2dpHALInterface.cpp
dom/bluetooth2/bluedroid/BluetoothAvrcpHALInterface.cpp
dom/bluetooth2/bluedroid/BluetoothHALInterface.cpp
dom/bluetooth2/bluedroid/BluetoothHandsfreeHALInterface.cpp
dom/indexedDB/IDBObjectStore.cpp
dom/ipc/StructuredCloneUtils.cpp
dom/promise/Promise.cpp
dom/promise/PromiseWorkerProxy.h
dom/system/gonk/NetworkUtils.cpp
dom/system/gonk/NetworkUtils.h
dom/workers/ChromeWorkerScope.cpp
dom/workers/Navigator.cpp
dom/workers/RuntimeService.cpp
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerPrivate.h
dom/workers/XMLHttpRequest.cpp
js/src/ctypes/CTypes.cpp
js/src/ctypes/CTypes.h
js/src/ctypes/Library.cpp
js/src/ctypes/Library.h
js/src/jsapi.cpp
js/src/jsapi.h
js/src/vm/Runtime.h
js/xpconnect/src/XPCLocale.cpp
--- a/dom/base/Console.cpp
+++ b/dom/base/Console.cpp
@@ -126,17 +126,17 @@ ConsoleStructuredCloneCallbacksWrite(JSC
 
 static void
 ConsoleStructuredCloneCallbacksError(JSContext* /* aCx */,
                                      uint32_t /* aErrorId */)
 {
   NS_WARNING("Failed to clone data for the Console API in workers.");
 }
 
-static const JSStructuredCloneCallbacks gConsoleCallbacks = {
+JSStructuredCloneCallbacks gConsoleCallbacks = {
   ConsoleStructuredCloneCallbacksRead,
   ConsoleStructuredCloneCallbacksWrite,
   ConsoleStructuredCloneCallbacksError
 };
 
 class ConsoleCallData MOZ_FINAL : public LinkedListElement<ConsoleCallData>
 {
 public:
--- a/dom/base/MessagePort.cpp
+++ b/dom/base/MessagePort.cpp
@@ -282,17 +282,17 @@ PostMessageFreeTransferStructuredClone(u
 
   if (aTag == SCTAG_DOM_MAP_MESSAGEPORT) {
     MOZ_ASSERT(aOwnership == JS::SCTAG_TMO_CUSTOM);
     nsRefPtr<MessagePort> port(static_cast<MessagePort*>(aData));
     scInfo->mPorts.Remove(port);
   }
 }
 
-const JSStructuredCloneCallbacks kPostMessageCallbacks = {
+JSStructuredCloneCallbacks kPostMessageCallbacks = {
   PostMessageReadStructuredClone,
   PostMessageWriteStructuredClone,
   nullptr,
   PostMessageReadTransferStructuredClone,
   PostMessageTransferStructuredClone,
   PostMessageFreeTransferStructuredClone
 };
 
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -8067,17 +8067,17 @@ PostMessageFreeTransferStructuredClone(u
   NS_ASSERTION(scInfo, "Must have scInfo!");
 
   if (aTag == SCTAG_DOM_MAP_MESSAGEPORT) {
     nsRefPtr<MessagePortBase> port(static_cast<MessagePort*>(aContent));
     scInfo->ports.Remove(port);
   }
 }
 
-const JSStructuredCloneCallbacks kPostMessageCallbacks = {
+JSStructuredCloneCallbacks kPostMessageCallbacks = {
   PostMessageReadStructuredClone,
   PostMessageWriteStructuredClone,
   nullptr,
   PostMessageReadTransferStructuredClone,
   PostMessageTransferStructuredClone,
   PostMessageFreeTransferStructuredClone
 };
 
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -2749,28 +2749,28 @@ nsJSContext::EnsureStatics()
   }
 
   // Let's make sure that our main thread is the same as the xpcom main thread.
   MOZ_ASSERT(NS_IsMainThread());
 
   sPrevGCSliceCallback = JS::SetGCSliceCallback(sRuntime, DOMGCSliceCallback);
 
   // Set up the structured clone callbacks.
-  static const JSStructuredCloneCallbacks cloneCallbacks = {
+  static JSStructuredCloneCallbacks cloneCallbacks = {
     NS_DOMReadStructuredClone,
     NS_DOMWriteStructuredClone,
     NS_DOMStructuredCloneError,
     nullptr,
     nullptr,
     nullptr
   };
   JS_SetStructuredCloneCallbacks(sRuntime, &cloneCallbacks);
 
   // Set up the asm.js cache callbacks
-  static const JS::AsmJSCacheOps asmJSCacheOps = {
+  static JS::AsmJSCacheOps asmJSCacheOps = {
     AsmJSCacheOpenEntryForRead,
     asmjscache::CloseEntryForRead,
     AsmJSCacheOpenEntryForWrite,
     asmjscache::CloseEntryForWrite,
     asmjscache::GetBuildId
   };
   JS::SetAsmJSCacheOps(sRuntime, &asmJSCacheOps);
 
--- a/dom/bluetooth/bluedroid/BluetoothA2dpHALInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothA2dpHALInterface.cpp
@@ -107,17 +107,17 @@ BluetoothA2dpHALInterface::BluetoothA2dp
 BluetoothA2dpHALInterface::~BluetoothA2dpHALInterface()
 { }
 
 void
 BluetoothA2dpHALInterface::Init(
   BluetoothA2dpNotificationHandler* aNotificationHandler,
   BluetoothA2dpResultHandler* aRes)
 {
-  static const btav_callbacks_t sCallbacks = {
+  static btav_callbacks_t sCallbacks = {
     sizeof(sCallbacks),
     BluetoothA2dpHALCallback::ConnectionState,
     BluetoothA2dpHALCallback::AudioState
   };
 
   sA2dpNotificationHandler = aNotificationHandler;
 
   bt_status_t status = mInterface->init(&sCallbacks);
--- a/dom/bluetooth/bluedroid/BluetoothAvrcpHALInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothAvrcpHALInterface.cpp
@@ -247,17 +247,17 @@ BluetoothAvrcpHALInterface::~BluetoothAv
 { }
 
 void
 BluetoothAvrcpHALInterface::Init(
   BluetoothAvrcpNotificationHandler* aNotificationHandler,
   BluetoothAvrcpResultHandler* aRes)
 {
 #if ANDROID_VERSION >= 18
-  static const btrc_callbacks_t sCallbacks = {
+  static btrc_callbacks_t sCallbacks = {
     sizeof(sCallbacks),
 #if ANDROID_VERSION >= 19
     BluetoothAvrcpCallback::RemoteFeature,
 #endif
     BluetoothAvrcpCallback::GetPlayStatus,
     BluetoothAvrcpCallback::ListPlayerAppAttr,
     BluetoothAvrcpCallback::ListPlayerAppValues,
     BluetoothAvrcpCallback::GetPlayerAppValue,
--- a/dom/bluetooth/bluedroid/BluetoothHALInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothHALInterface.cpp
@@ -390,17 +390,17 @@ BluetoothHALInterface::BluetoothHALInter
 BluetoothHALInterface::~BluetoothHALInterface()
 { }
 
 void
 BluetoothHALInterface::Init(
   BluetoothNotificationHandler* aNotificationHandler,
   BluetoothResultHandler* aRes)
 {
-  static const bt_callbacks_t sBluetoothCallbacks = {
+  static bt_callbacks_t sBluetoothCallbacks = {
     sizeof(sBluetoothCallbacks),
     BluetoothCallback::AdapterStateChanged,
     BluetoothCallback::AdapterProperties,
     BluetoothCallback::RemoteDeviceProperties,
     BluetoothCallback::DeviceFound,
     BluetoothCallback::DiscoveryStateChanged,
     BluetoothCallback::PinRequest,
     BluetoothCallback::SspRequest,
--- a/dom/bluetooth/bluedroid/BluetoothHandsfreeHALInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothHandsfreeHALInterface.cpp
@@ -266,17 +266,17 @@ BluetoothHandsfreeHALInterface::Bluetoot
 BluetoothHandsfreeHALInterface::~BluetoothHandsfreeHALInterface()
 { }
 
 void
 BluetoothHandsfreeHALInterface::Init(
   BluetoothHandsfreeNotificationHandler* aNotificationHandler,
   BluetoothHandsfreeResultHandler* aRes)
 {
-  static const bthf_callbacks_t sCallbacks = {
+  static bthf_callbacks_t sCallbacks = {
     sizeof(sCallbacks),
     BluetoothHandsfreeHALCallback::ConnectionState,
     BluetoothHandsfreeHALCallback::AudioState,
     BluetoothHandsfreeHALCallback::VoiceRecognition,
     BluetoothHandsfreeHALCallback::AnswerCall,
     BluetoothHandsfreeHALCallback::HangupCall,
     BluetoothHandsfreeHALCallback::Volume,
     BluetoothHandsfreeHALCallback::DialCall,
--- a/dom/bluetooth2/bluedroid/BluetoothA2dpHALInterface.cpp
+++ b/dom/bluetooth2/bluedroid/BluetoothA2dpHALInterface.cpp
@@ -107,17 +107,17 @@ BluetoothA2dpHALInterface::BluetoothA2dp
 BluetoothA2dpHALInterface::~BluetoothA2dpHALInterface()
 { }
 
 void
 BluetoothA2dpHALInterface::Init(
   BluetoothA2dpNotificationHandler* aNotificationHandler,
   BluetoothA2dpResultHandler* aRes)
 {
-  static const btav_callbacks_t sCallbacks = {
+  static btav_callbacks_t sCallbacks = {
     sizeof(sCallbacks),
     BluetoothA2dpHALCallback::ConnectionState,
     BluetoothA2dpHALCallback::AudioState
   };
 
   sA2dpNotificationHandler = aNotificationHandler;
 
   bt_status_t status = mInterface->init(&sCallbacks);
--- a/dom/bluetooth2/bluedroid/BluetoothAvrcpHALInterface.cpp
+++ b/dom/bluetooth2/bluedroid/BluetoothAvrcpHALInterface.cpp
@@ -247,17 +247,17 @@ BluetoothAvrcpHALInterface::~BluetoothAv
 { }
 
 void
 BluetoothAvrcpHALInterface::Init(
   BluetoothAvrcpNotificationHandler* aNotificationHandler,
   BluetoothAvrcpResultHandler* aRes)
 {
 #if ANDROID_VERSION >= 18
-  static const btrc_callbacks_t sCallbacks = {
+  static btrc_callbacks_t sCallbacks = {
     sizeof(sCallbacks),
 #if ANDROID_VERSION >= 19
     BluetoothAvrcpCallback::RemoteFeature,
 #endif
     BluetoothAvrcpCallback::GetPlayStatus,
     BluetoothAvrcpCallback::ListPlayerAppAttr,
     BluetoothAvrcpCallback::ListPlayerAppValues,
     BluetoothAvrcpCallback::GetPlayerAppValue,
--- a/dom/bluetooth2/bluedroid/BluetoothHALInterface.cpp
+++ b/dom/bluetooth2/bluedroid/BluetoothHALInterface.cpp
@@ -405,17 +405,17 @@ BluetoothHALInterface::BluetoothHALInter
 BluetoothHALInterface::~BluetoothHALInterface()
 { }
 
 void
 BluetoothHALInterface::Init(
   BluetoothNotificationHandler* aNotificationHandler,
   BluetoothResultHandler* aRes)
 {
-  static const bt_callbacks_t sBluetoothCallbacks = {
+  static bt_callbacks_t sBluetoothCallbacks = {
     sizeof(sBluetoothCallbacks),
     BluetoothCallback::AdapterStateChanged,
     BluetoothCallback::AdapterProperties,
     BluetoothCallback::RemoteDeviceProperties,
     BluetoothCallback::DeviceFound,
     BluetoothCallback::DiscoveryStateChanged,
     BluetoothCallback::PinRequest,
     BluetoothCallback::SspRequest,
--- a/dom/bluetooth2/bluedroid/BluetoothHandsfreeHALInterface.cpp
+++ b/dom/bluetooth2/bluedroid/BluetoothHandsfreeHALInterface.cpp
@@ -266,17 +266,17 @@ BluetoothHandsfreeHALInterface::Bluetoot
 BluetoothHandsfreeHALInterface::~BluetoothHandsfreeHALInterface()
 { }
 
 void
 BluetoothHandsfreeHALInterface::Init(
   BluetoothHandsfreeNotificationHandler* aNotificationHandler,
   BluetoothHandsfreeResultHandler* aRes)
 {
-  static const bthf_callbacks_t sCallbacks = {
+  static bthf_callbacks_t sCallbacks = {
     sizeof(sCallbacks),
     BluetoothHandsfreeHALCallback::ConnectionState,
     BluetoothHandsfreeHALCallback::AudioState,
     BluetoothHandsfreeHALCallback::VoiceRecognition,
     BluetoothHandsfreeHALCallback::AnswerCall,
     BluetoothHandsfreeHALCallback::HangupCall,
     BluetoothHandsfreeHALCallback::Volume,
     BluetoothHandsfreeHALCallback::DialCall,
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -996,17 +996,17 @@ IDBObjectStore::DeserializeValue(JSConte
 
   auto* data = reinterpret_cast<uint64_t*>(aCloneReadInfo.mData.Elements());
   size_t dataLen = aCloneReadInfo.mData.Length();
 
   MOZ_ASSERT(!(dataLen % sizeof(*data)));
 
   JSAutoRequest ar(aCx);
 
-  static const JSStructuredCloneCallbacks callbacks = {
+  static JSStructuredCloneCallbacks callbacks = {
     CommonStructuredCloneReadCallback<ValueDeserializationHelper>,
     nullptr,
     nullptr,
     nullptr,
     nullptr,
     nullptr
   };
 
@@ -1037,17 +1037,17 @@ IDBObjectStore::DeserializeIndexValue(JS
   uint64_t* data =
     const_cast<uint64_t*>(reinterpret_cast<uint64_t*>(
       aCloneReadInfo.mData.Elements()));
 
   MOZ_ASSERT(!(dataLen % sizeof(*data)));
 
   JSAutoRequest ar(aCx);
 
-  static const JSStructuredCloneCallbacks callbacks = {
+  static JSStructuredCloneCallbacks callbacks = {
     CommonStructuredCloneReadCallback<IndexDeserializationHelper>,
     nullptr,
     nullptr
   };
 
   if (!JS_ReadStructuredClone(aCx, data, dataLen, JS_STRUCTURED_CLONE_VERSION,
                               aValue, &callbacks, &aCloneReadInfo)) {
     return false;
--- a/dom/ipc/StructuredCloneUtils.cpp
+++ b/dom/ipc/StructuredCloneUtils.cpp
@@ -96,17 +96,17 @@ Write(JSContext* aCx, JSStructuredCloneW
       closure->mBlobs.AppendElement(blob);
       return true;
     }
   }
 
   return NS_DOMWriteStructuredClone(aCx, aWriter, aObj, nullptr);
 }
 
-const JSStructuredCloneCallbacks gCallbacks = {
+JSStructuredCloneCallbacks gCallbacks = {
   Read,
   Write,
   Error,
   nullptr,
   nullptr,
   nullptr
 };
 
--- a/dom/promise/Promise.cpp
+++ b/dom/promise/Promise.cpp
@@ -1241,17 +1241,17 @@ Promise::GetDependentPromises(nsTArray<n
 }
 
 // A WorkerRunnable to resolve/reject the Promise on the worker thread.
 
 class PromiseWorkerProxyRunnable : public workers::WorkerRunnable
 {
 public:
   PromiseWorkerProxyRunnable(PromiseWorkerProxy* aPromiseWorkerProxy,
-                             const JSStructuredCloneCallbacks* aCallbacks,
+                             JSStructuredCloneCallbacks* aCallbacks,
                              JSAutoStructuredCloneBuffer&& aBuffer,
                              PromiseWorkerProxy::RunCallbackFunc aFunc)
     : WorkerRunnable(aPromiseWorkerProxy->GetWorkerPrivate(),
                      WorkerThreadUnchangedBusyCount)
     , mPromiseWorkerProxy(aPromiseWorkerProxy)
     , mCallbacks(aCallbacks)
     , mBuffer(Move(aBuffer))
     , mFunc(aFunc)
@@ -1287,26 +1287,26 @@ public:
     return true;
   }
 
 protected:
   ~PromiseWorkerProxyRunnable() {}
 
 private:
   nsRefPtr<PromiseWorkerProxy> mPromiseWorkerProxy;
-  const JSStructuredCloneCallbacks* mCallbacks;
+  JSStructuredCloneCallbacks* mCallbacks;
   JSAutoStructuredCloneBuffer mBuffer;
 
   // Function pointer for calling Promise::{ResolveInternal,RejectInternal}.
   PromiseWorkerProxy::RunCallbackFunc mFunc;
 };
 
 PromiseWorkerProxy::PromiseWorkerProxy(WorkerPrivate* aWorkerPrivate,
                                        Promise* aWorkerPromise,
-                                       const JSStructuredCloneCallbacks* aCallbacks)
+                                       JSStructuredCloneCallbacks* aCallbacks)
   : mWorkerPrivate(aWorkerPrivate)
   , mWorkerPromise(aWorkerPromise)
   , mCleanedUp(false)
   , mCallbacks(aCallbacks)
   , mCleanUpLock("cleanUpLock")
 {
   MOZ_ASSERT(mWorkerPrivate);
   mWorkerPrivate->AssertIsOnWorkerThread();
--- a/dom/promise/PromiseWorkerProxy.h
+++ b/dom/promise/PromiseWorkerProxy.h
@@ -62,17 +62,17 @@ class PromiseWorkerProxy : public Promis
   friend class PromiseWorkerProxyRunnable;
 
   // This overrides the non-threadsafe refcounting in PromiseNativeHandler.
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PromiseWorkerProxy)
 
 public:
   PromiseWorkerProxy(workers::WorkerPrivate* aWorkerPrivate,
                      Promise* aWorkerPromise,
-                     const JSStructuredCloneCallbacks* aCallbacks = nullptr);
+                     JSStructuredCloneCallbacks* aCallbacks = nullptr);
 
   workers::WorkerPrivate* GetWorkerPrivate() const;
 
   Promise* GetWorkerPromise() const;
 
   void StoreISupports(nsISupports* aSupports);
 
   void CleanUp(JSContext* aCx);
@@ -99,17 +99,17 @@ private:
 
   workers::WorkerPrivate* mWorkerPrivate;
 
   // This lives on the worker thread.
   nsRefPtr<Promise> mWorkerPromise;
 
   bool mCleanedUp; // To specify if the cleanUp() has been done.
 
-  const JSStructuredCloneCallbacks* mCallbacks;
+  JSStructuredCloneCallbacks* mCallbacks;
 
   // Aimed to keep objects alive when doing the structured-clone read/write,
   // which can be added by calling StoreISupports() on the main thread.
   nsTArray<nsMainThreadPtrHandle<nsISupports>> mSupportsArray;
 
   // Ensure the worker and the main thread won't race to access |mCleanedUp|.
   Mutex mCleanUpLock;
 };
--- a/dom/system/gonk/NetworkUtils.cpp
+++ b/dom/system/gonk/NetworkUtils.cpp
@@ -118,54 +118,54 @@ typedef Tuple3<NetdCommand*, CommandChai
 static NetworkUtils* gNetworkUtils;
 static nsTArray<QueueData> gCommandQueue;
 static CurrentCommand gCurrentCommand;
 static bool gPending = false;
 static nsTArray<nsCString> gReason;
 static NetworkParams *gWifiTetheringParms = 0;
 
 
-const CommandFunc NetworkUtils::sWifiEnableChain[] = {
+CommandFunc NetworkUtils::sWifiEnableChain[] = {
   NetworkUtils::clearWifiTetherParms,
   NetworkUtils::wifiFirmwareReload,
   NetworkUtils::startAccessPointDriver,
   NetworkUtils::setAccessPoint,
   NetworkUtils::startSoftAP,
   NetworkUtils::setInterfaceUp,
   NetworkUtils::tetherInterface,
   NetworkUtils::setIpForwardingEnabled,
   NetworkUtils::tetheringStatus,
   NetworkUtils::startTethering,
   NetworkUtils::setDnsForwarders,
   NetworkUtils::enableNat,
   NetworkUtils::wifiTetheringSuccess
 };
 
-const CommandFunc NetworkUtils::sWifiDisableChain[] = {
+CommandFunc NetworkUtils::sWifiDisableChain[] = {
   NetworkUtils::clearWifiTetherParms,
   NetworkUtils::stopSoftAP,
   NetworkUtils::stopAccessPointDriver,
   NetworkUtils::wifiFirmwareReload,
   NetworkUtils::untetherInterface,
   NetworkUtils::preTetherInterfaceList,
   NetworkUtils::postTetherInterfaceList,
   NetworkUtils::disableNat,
   NetworkUtils::setIpForwardingEnabled,
   NetworkUtils::stopTethering,
   NetworkUtils::wifiTetheringSuccess
 };
 
-const CommandFunc NetworkUtils::sWifiFailChain[] = {
+CommandFunc NetworkUtils::sWifiFailChain[] = {
   NetworkUtils::clearWifiTetherParms,
   NetworkUtils::stopSoftAP,
   NetworkUtils::setIpForwardingEnabled,
   NetworkUtils::stopTethering
 };
 
-const CommandFunc NetworkUtils::sWifiRetryChain[] = {
+CommandFunc NetworkUtils::sWifiRetryChain[] = {
   NetworkUtils::clearWifiTetherParms,
   NetworkUtils::stopSoftAP,
   NetworkUtils::stopTethering,
 
   // sWifiEnableChain:
   NetworkUtils::wifiFirmwareReload,
   NetworkUtils::startAccessPointDriver,
   NetworkUtils::setAccessPoint,
@@ -175,84 +175,84 @@ const CommandFunc NetworkUtils::sWifiRet
   NetworkUtils::setIpForwardingEnabled,
   NetworkUtils::tetheringStatus,
   NetworkUtils::startTethering,
   NetworkUtils::setDnsForwarders,
   NetworkUtils::enableNat,
   NetworkUtils::wifiTetheringSuccess
 };
 
-const CommandFunc NetworkUtils::sWifiOperationModeChain[] = {
+CommandFunc NetworkUtils::sWifiOperationModeChain[] = {
   NetworkUtils::wifiFirmwareReload,
   NetworkUtils::wifiOperationModeSuccess
 };
 
-const CommandFunc NetworkUtils::sUSBEnableChain[] = {
+CommandFunc NetworkUtils::sUSBEnableChain[] = {
   NetworkUtils::setInterfaceUp,
   NetworkUtils::enableNat,
   NetworkUtils::setIpForwardingEnabled,
   NetworkUtils::tetherInterface,
   NetworkUtils::tetheringStatus,
   NetworkUtils::startTethering,
   NetworkUtils::setDnsForwarders,
   NetworkUtils::usbTetheringSuccess
 };
 
-const CommandFunc NetworkUtils::sUSBDisableChain[] = {
+CommandFunc NetworkUtils::sUSBDisableChain[] = {
   NetworkUtils::untetherInterface,
   NetworkUtils::preTetherInterfaceList,
   NetworkUtils::postTetherInterfaceList,
   NetworkUtils::disableNat,
   NetworkUtils::setIpForwardingEnabled,
   NetworkUtils::stopTethering,
   NetworkUtils::usbTetheringSuccess
 };
 
-const CommandFunc NetworkUtils::sUSBFailChain[] = {
+CommandFunc NetworkUtils::sUSBFailChain[] = {
   NetworkUtils::stopSoftAP,
   NetworkUtils::setIpForwardingEnabled,
   NetworkUtils::stopTethering
 };
 
-const CommandFunc NetworkUtils::sUpdateUpStreamChain[] = {
+CommandFunc NetworkUtils::sUpdateUpStreamChain[] = {
   NetworkUtils::cleanUpStream,
   NetworkUtils::createUpStream,
   NetworkUtils::updateUpStreamSuccess
 };
 
-const CommandFunc NetworkUtils::sStartDhcpServerChain[] = {
+CommandFunc NetworkUtils::sStartDhcpServerChain[] = {
   NetworkUtils::setInterfaceUp,
   NetworkUtils::startTethering,
   NetworkUtils::setDhcpServerSuccess
 };
 
-const CommandFunc NetworkUtils::sStopDhcpServerChain[] = {
+CommandFunc NetworkUtils::sStopDhcpServerChain[] = {
   NetworkUtils::stopTethering,
   NetworkUtils::setDhcpServerSuccess
 };
 
-const CommandFunc NetworkUtils::sNetworkInterfaceEnableAlarmChain[] = {
+CommandFunc NetworkUtils::sNetworkInterfaceEnableAlarmChain[] = {
   NetworkUtils::enableAlarm,
   NetworkUtils::setQuota,
   NetworkUtils::setAlarm,
   NetworkUtils::networkInterfaceAlarmSuccess
 };
 
-const CommandFunc NetworkUtils::sNetworkInterfaceDisableAlarmChain[] = {
+CommandFunc NetworkUtils::sNetworkInterfaceDisableAlarmChain[] = {
   NetworkUtils::removeQuota,
   NetworkUtils::disableAlarm,
   NetworkUtils::networkInterfaceAlarmSuccess
 };
 
-const CommandFunc NetworkUtils::sNetworkInterfaceSetAlarmChain[] = {
+CommandFunc NetworkUtils::sNetworkInterfaceSetAlarmChain[] = {
   NetworkUtils::setAlarm,
   NetworkUtils::networkInterfaceAlarmSuccess
 };
 
-const CommandFunc NetworkUtils::sSetDnsChain[] = {
+CommandFunc NetworkUtils::sSetDnsChain[] = {
   NetworkUtils::setDefaultInterface,
   NetworkUtils::setInterfaceDns
 };
 
 /**
  * Helper function to get the mask from given prefix length.
  */
 static uint32_t makeMask(const uint32_t prefixLength)
--- a/dom/system/gonk/NetworkUtils.h
+++ b/dom/system/gonk/NetworkUtils.h
@@ -159,17 +159,17 @@ public:
 // 1. Command parameters.
 // 2. Command list.
 // 3. Error callback function.
 // 4. Index of current execution command.
 class CommandChain MOZ_FINAL
 {
 public:
   CommandChain(const NetworkParams& aParams,
-               const CommandFunc aCmds[],
+               CommandFunc aCmds[],
                uint32_t aLength,
                ErrorCallback aError)
   : mIndex(-1)
   , mParams(aParams)
   , mCommands(aCmds)
   , mLength(aLength)
   , mError(aError) {
   }
@@ -191,17 +191,17 @@ public:
   getErrorCallback() const
   {
     return mError;
   };
 
 private:
   uint32_t mIndex;
   NetworkParams mParams;
-  const CommandFunc* mCommands;
+  CommandFunc* mCommands;
   uint32_t mLength;
   ErrorCallback mError;
 };
 
 // A helper class to easily construct a resolved
 // or a pending result for command execution.
 class CommandResult
 {
@@ -258,31 +258,31 @@ private:
   CommandResult setUSBTethering(NetworkParams& aOptions);
   CommandResult enableUsbRndis(NetworkParams& aOptions);
   CommandResult updateUpStream(NetworkParams& aOptions);
 
   /**
    * function pointer array holds all netd commands should be executed
    * in sequence to accomplish a given command by other module.
    */
-  static const CommandFunc sWifiEnableChain[];
-  static const CommandFunc sWifiDisableChain[];
-  static const CommandFunc sWifiFailChain[];
-  static const CommandFunc sWifiRetryChain[];
-  static const CommandFunc sWifiOperationModeChain[];
-  static const CommandFunc sUSBEnableChain[];
-  static const CommandFunc sUSBDisableChain[];
-  static const CommandFunc sUSBFailChain[];
-  static const CommandFunc sUpdateUpStreamChain[];
-  static const CommandFunc sStartDhcpServerChain[];
-  static const CommandFunc sStopDhcpServerChain[];
-  static const CommandFunc sNetworkInterfaceEnableAlarmChain[];
-  static const CommandFunc sNetworkInterfaceDisableAlarmChain[];
-  static const CommandFunc sNetworkInterfaceSetAlarmChain[];
-  static const CommandFunc sSetDnsChain[];
+  static CommandFunc sWifiEnableChain[];
+  static CommandFunc sWifiDisableChain[];
+  static CommandFunc sWifiFailChain[];
+  static CommandFunc sWifiRetryChain[];
+  static CommandFunc sWifiOperationModeChain[];
+  static CommandFunc sUSBEnableChain[];
+  static CommandFunc sUSBDisableChain[];
+  static CommandFunc sUSBFailChain[];
+  static CommandFunc sUpdateUpStreamChain[];
+  static CommandFunc sStartDhcpServerChain[];
+  static CommandFunc sStopDhcpServerChain[];
+  static CommandFunc sNetworkInterfaceEnableAlarmChain[];
+  static CommandFunc sNetworkInterfaceDisableAlarmChain[];
+  static CommandFunc sNetworkInterfaceSetAlarmChain[];
+  static CommandFunc sSetDnsChain[];
 
   /**
    * Individual netd command stored in command chain.
    */
 #define PARAMS CommandChain* aChain, CommandCallback aCallback, \
                mozilla::dom::NetworkResultOptions& aResult
   static void wifiFirmwareReload(PARAMS);
   static void startAccessPointDriver(PARAMS);
--- a/dom/workers/ChromeWorkerScope.cpp
+++ b/dom/workers/ChromeWorkerScope.cpp
@@ -54,17 +54,17 @@ DefineChromeWorkerFunctions(JSContext* a
 #ifdef BUILD_CTYPES
   {
     JS::Rooted<JS::Value> ctypes(aCx);
     if (!JS_InitCTypesClass(aCx, aGlobal) ||
         !JS_GetProperty(aCx, aGlobal, "ctypes", &ctypes)) {
       return false;
     }
 
-    static const JSCTypesCallbacks callbacks = {
+    static JSCTypesCallbacks callbacks = {
       UnicodeToNative
     };
 
     JS_SetCTypesCallbacks(ctypes.toObjectOrNull(), &callbacks);
   }
 #endif // BUILD_CTYPES
 
   return true;
--- a/dom/workers/Navigator.cpp
+++ b/dom/workers/Navigator.cpp
@@ -189,17 +189,17 @@ GetDataStoresStructuredCloneCallbacksWri
   if (!JS_WriteBytes(aWriter, &dataStoreholder, sizeof(dataStoreholder))) {
     MOZ_ASSERT(false, "cannot write bytes for dataStoreholder!");
     return false;
   }
 
   return true;
 }
 
-static const JSStructuredCloneCallbacks kGetDataStoresStructuredCloneCallbacks = {
+static JSStructuredCloneCallbacks kGetDataStoresStructuredCloneCallbacks = {
   GetDataStoresStructuredCloneCallbacksRead,
   GetDataStoresStructuredCloneCallbacksWrite,
   nullptr
 };
 
 // A WorkerMainThreadRunnable to run WorkerNavigator::GetDataStores(...) on the
 // main thread.
 class NavigatorGetDataStoresRunnable MOZ_FINAL : public WorkerMainThreadRunnable
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -770,23 +770,23 @@ CreateJSContextForWorker(WorkerPrivate* 
       NS_ASSERTION(setting.value, "Can't handle 0 values!");
       JS_SetGCParameter(aRuntime, setting.key, setting.value);
     }
   }
 
   JS_SetNativeStackQuota(aRuntime, WORKER_CONTEXT_NATIVE_STACK_LIMIT);
 
   // Security policy:
-  static const JSSecurityCallbacks securityCallbacks = {
+  static JSSecurityCallbacks securityCallbacks = {
     ContentSecurityPolicyAllows
   };
   JS_SetSecurityCallbacks(aRuntime, &securityCallbacks);
 
   // Set up the asm.js cache callbacks
-  static const JS::AsmJSCacheOps asmJSCacheOps = {
+  static JS::AsmJSCacheOps asmJSCacheOps = {
     AsmJSCacheOpenEntryForRead,
     asmjscache::CloseEntryForRead,
     AsmJSCacheOpenEntryForWrite,
     asmjscache::CloseEntryForWrite,
     asmjscache::GetBuildId
   };
   JS::SetAsmJSCacheOps(aRuntime, &asmJSCacheOps);
 
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -381,17 +381,17 @@ struct WorkerStructuredCloneCallbacks
 
   static void
   Error(JSContext* aCx, uint32_t /* aErrorId */)
   {
     Throw(aCx, NS_ERROR_DOM_DATA_CLONE_ERR);
   }
 };
 
-const JSStructuredCloneCallbacks gWorkerStructuredCloneCallbacks = {
+JSStructuredCloneCallbacks gWorkerStructuredCloneCallbacks = {
   WorkerStructuredCloneCallbacks::Read,
   WorkerStructuredCloneCallbacks::Write,
   WorkerStructuredCloneCallbacks::Error,
   nullptr,
   nullptr,
   nullptr
 };
 
@@ -478,17 +478,17 @@ struct MainThreadWorkerStructuredCloneCa
   Error(JSContext* aCx, uint32_t aErrorId)
   {
     AssertIsOnMainThread();
 
     NS_DOMStructuredCloneError(aCx, aErrorId);
   }
 };
 
-const JSStructuredCloneCallbacks gMainThreadWorkerStructuredCloneCallbacks = {
+JSStructuredCloneCallbacks gMainThreadWorkerStructuredCloneCallbacks = {
   MainThreadWorkerStructuredCloneCallbacks::Read,
   MainThreadWorkerStructuredCloneCallbacks::Write,
   MainThreadWorkerStructuredCloneCallbacks::Error,
   nullptr,
   nullptr,
   nullptr
 };
 
@@ -511,17 +511,17 @@ struct ChromeWorkerStructuredCloneCallba
 
   static void
   Error(JSContext* aCx, uint32_t aErrorId)
   {
     return WorkerStructuredCloneCallbacks::Error(aCx, aErrorId);
   }
 };
 
-const JSStructuredCloneCallbacks gChromeWorkerStructuredCloneCallbacks = {
+JSStructuredCloneCallbacks gChromeWorkerStructuredCloneCallbacks = {
   ChromeWorkerStructuredCloneCallbacks::Read,
   ChromeWorkerStructuredCloneCallbacks::Write,
   ChromeWorkerStructuredCloneCallbacks::Error,
   nullptr,
   nullptr,
   nullptr
 };
 
@@ -572,17 +572,17 @@ struct MainThreadChromeWorkerStructuredC
   Error(JSContext* aCx, uint32_t aErrorId)
   {
     AssertIsOnMainThread();
 
     NS_DOMStructuredCloneError(aCx, aErrorId);
   }
 };
 
-const JSStructuredCloneCallbacks gMainThreadChromeWorkerStructuredCloneCallbacks = {
+JSStructuredCloneCallbacks gMainThreadChromeWorkerStructuredCloneCallbacks = {
   MainThreadChromeWorkerStructuredCloneCallbacks::Read,
   MainThreadChromeWorkerStructuredCloneCallbacks::Write,
   MainThreadChromeWorkerStructuredCloneCallbacks::Error,
   nullptr,
   nullptr,
   nullptr
 };
 
@@ -2658,17 +2658,17 @@ WorkerPrivateParent<Derived>::PostMessag
 
   {
     MutexAutoLock lock(mMutex);
     if (mParentStatus > Running) {
       return;
     }
   }
 
-  const JSStructuredCloneCallbacks* callbacks;
+  JSStructuredCloneCallbacks* callbacks;
   if (GetParent()) {
     if (IsChromeWorker()) {
       callbacks = &gChromeWorkerStructuredCloneCallbacks;
     }
     else {
       callbacks = &gWorkerStructuredCloneCallbacks;
     }
   }
@@ -5156,17 +5156,17 @@ WorkerPrivate::PostMessageToParentIntern
     JSObject* array = JS_NewArrayObject(aCx, elements);
     if (!array) {
       aRv = NS_ERROR_OUT_OF_MEMORY;
       return;
     }
     transferable.setObject(*array);
   }
 
-  const JSStructuredCloneCallbacks* callbacks =
+  JSStructuredCloneCallbacks* callbacks =
     IsChromeWorker() ?
     &gChromeWorkerStructuredCloneCallbacks :
     &gWorkerStructuredCloneCallbacks;
 
   nsTArray<nsCOMPtr<nsISupports>> clonedObjects;
 
   JSAutoStructuredCloneBuffer buffer;
   if (!buffer.write(aCx, aMessage, transferable, callbacks, &clonedObjects)) {
@@ -6179,25 +6179,25 @@ GetWorkerCrossThreadDispatcher(JSContext
   }
 
   WorkerPrivate* w = nullptr;
   UNWRAP_OBJECT(Worker, &aWorker.toObject(), w);
   MOZ_ASSERT(w);
   return w->GetCrossThreadDispatcher();
 }
 
-const JSStructuredCloneCallbacks*
+JSStructuredCloneCallbacks*
 WorkerStructuredCloneCallbacks(bool aMainRuntime)
 {
   return aMainRuntime ?
          &gMainThreadWorkerStructuredCloneCallbacks :
          &gWorkerStructuredCloneCallbacks;
 }
 
-const JSStructuredCloneCallbacks*
+JSStructuredCloneCallbacks*
 ChromeWorkerStructuredCloneCallbacks(bool aMainRuntime)
 {
   return aMainRuntime ?
          &gMainThreadChromeWorkerStructuredCloneCallbacks :
          &gChromeWorkerStructuredCloneCallbacks;
 }
 
 // Force instantiation.
--- a/dom/workers/WorkerPrivate.h
+++ b/dom/workers/WorkerPrivate.h
@@ -1291,20 +1291,20 @@ GetCurrentThreadJSContext();
 
 enum WorkerStructuredDataType
 {
   DOMWORKER_SCTAG_BLOB = SCTAG_DOM_MAX,
 
   DOMWORKER_SCTAG_END
 };
 
-const JSStructuredCloneCallbacks*
+JSStructuredCloneCallbacks*
 WorkerStructuredCloneCallbacks(bool aMainRuntime);
 
-const JSStructuredCloneCallbacks*
+JSStructuredCloneCallbacks*
 ChromeWorkerStructuredCloneCallbacks(bool aMainRuntime);
 
 class AutoSyncLoopHolder
 {
   WorkerPrivate* mWorkerPrivate;
   nsCOMPtr<nsIEventTarget> mTarget;
   uint32_t mIndex;
 
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -1214,17 +1214,17 @@ EventRunnable::PreDispatch(JSContext* aC
               mResponseResult = NS_ERROR_OUT_OF_MEMORY;
               doClone = false;
             }
           }
         }
 
         if (doClone) {
           // Anything subject to GC must be cloned.
-          const JSStructuredCloneCallbacks* callbacks =
+          JSStructuredCloneCallbacks* callbacks =
             aWorkerPrivate->IsChromeWorker() ?
             workers::ChromeWorkerStructuredCloneCallbacks(true) :
             workers::WorkerStructuredCloneCallbacks(true);
 
           nsTArray<nsCOMPtr<nsISupports> > clonedObjects;
 
           if (mResponseBuffer.write(aCx, response, transferable, callbacks,
                                     &clonedObjects)) {
@@ -1326,17 +1326,17 @@ EventRunnable::WorkerRun(JSContext* aCx,
     state->mResponseResult = mResponseResult;
 
     if (NS_SUCCEEDED(mResponseResult)) {
       if (mResponseBuffer.data()) {
         MOZ_ASSERT(mResponse.isUndefined());
 
         JSAutoStructuredCloneBuffer responseBuffer(Move(mResponseBuffer));
 
-        const JSStructuredCloneCallbacks* callbacks =
+        JSStructuredCloneCallbacks* callbacks =
           aWorkerPrivate->IsChromeWorker() ?
           workers::ChromeWorkerStructuredCloneCallbacks(false) :
           workers::WorkerStructuredCloneCallbacks(false);
 
         nsTArray<nsCOMPtr<nsISupports> > clonedObjects;
         clonedObjects.SwapElements(mClonedObjects);
 
         JS::Rooted<JS::Value> response(aCx);
@@ -1510,17 +1510,17 @@ SendRunnable::MainThreadRun()
     AutoSafeJSContext cx;
     JSAutoRequest ar(cx);
 
     nsIXPConnect* xpc = nsContentUtils::XPConnect();
     MOZ_ASSERT(xpc);
 
     nsresult rv = NS_OK;
 
-    const JSStructuredCloneCallbacks* callbacks =
+    JSStructuredCloneCallbacks* callbacks =
       mWorkerPrivate->IsChromeWorker() ?
       workers::ChromeWorkerStructuredCloneCallbacks(true) :
       workers::WorkerStructuredCloneCallbacks(true);
 
     JS::Rooted<JS::Value> body(cx);
     if (mBody.read(cx, &body, callbacks, &mClonedObjects)) {
       if (NS_FAILED(xpc->JSValToVariant(cx, body, getter_AddRefs(variant)))) {
         rv = NS_ERROR_DOM_INVALID_STATE_ERR;
@@ -2134,17 +2134,17 @@ XMLHttpRequest::Send(JS::Handle<JSObject
     JSString* bodyStr = JS::ToString(cx, obj);
     if (!bodyStr) {
       aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
       return;
     }
     valToClone.setString(bodyStr);
   }
 
-  const JSStructuredCloneCallbacks* callbacks =
+  JSStructuredCloneCallbacks* callbacks =
     mWorkerPrivate->IsChromeWorker() ?
     ChromeWorkerStructuredCloneCallbacks(false) :
     WorkerStructuredCloneCallbacks(false);
 
   nsTArray<nsCOMPtr<nsISupports> > clonedObjects;
 
   JSAutoStructuredCloneBuffer buffer;
   if (!buffer.write(cx, valToClone, callbacks, &clonedObjects)) {
@@ -2172,17 +2172,17 @@ XMLHttpRequest::Send(File& aBody, ErrorR
   }
 
   JS::Rooted<JS::Value> value(cx);
   if (!GetOrCreateDOMReflector(cx, &aBody, &value)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
-  const JSStructuredCloneCallbacks* callbacks =
+  JSStructuredCloneCallbacks* callbacks =
     mWorkerPrivate->IsChromeWorker() ?
     ChromeWorkerStructuredCloneCallbacks(false) :
     WorkerStructuredCloneCallbacks(false);
 
   nsTArray<nsCOMPtr<nsISupports> > clonedObjects;
 
   JSAutoStructuredCloneBuffer buffer;
   if (!buffer.write(cx, value, callbacks, &clonedObjects)) {
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -1315,26 +1315,26 @@ IsCTypesGlobal(JSObject* obj)
 
 bool
 IsCTypesGlobal(HandleValue v)
 {
   return v.isObject() && IsCTypesGlobal(&v.toObject());
 }
 
 // Get the JSCTypesCallbacks struct from the 'ctypes' object 'obj'.
-const JSCTypesCallbacks*
+JSCTypesCallbacks*
 GetCallbacks(JSObject* obj)
 {
   MOZ_ASSERT(IsCTypesGlobal(obj));
 
   jsval result = JS_GetReservedSlot(obj, SLOT_CALLBACKS);
   if (result.isUndefined())
     return nullptr;
 
-  return static_cast<const JSCTypesCallbacks*>(result.toPrivate());
+  return static_cast<JSCTypesCallbacks*>(result.toPrivate());
 }
 
 // Utility function to access a property of an object as an object
 // returns false and sets the error if the property does not exist
 // or is not an object
 static bool GetObjectProperty(JSContext *cx, HandleObject obj,
                               const char *property, MutableHandleObject result)
 {
@@ -1401,24 +1401,23 @@ JS_InitCTypesClass(JSContext* cx, Handle
     return false;
 
 
   // Seal the ctypes object, to prevent modification.
   return JS_FreezeObject(cx, ctypes);
 }
 
 JS_PUBLIC_API(void)
-JS_SetCTypesCallbacks(JSObject *ctypesObj, const JSCTypesCallbacks* callbacks)
+JS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks* callbacks)
 {
   MOZ_ASSERT(callbacks);
   MOZ_ASSERT(IsCTypesGlobal(ctypesObj));
 
   // Set the callbacks on a reserved slot.
-  JS_SetReservedSlot(ctypesObj, SLOT_CALLBACKS,
-                     PRIVATE_TO_JSVAL(const_cast<JSCTypesCallbacks*>(callbacks)));
+  JS_SetReservedSlot(ctypesObj, SLOT_CALLBACKS, PRIVATE_TO_JSVAL(callbacks));
 }
 
 namespace js {
 
 JS_FRIEND_API(size_t)
 SizeOfDataIfCDataObject(mozilla::MallocSizeOf mallocSizeOf, JSObject *obj)
 {
     if (!CData::IsCData(obj))
--- a/js/src/ctypes/CTypes.h
+++ b/js/src/ctypes/CTypes.h
@@ -339,17 +339,17 @@ struct ClosureInfo
       ffi_closure_free(closure);
     js_free(errResult);
   }
 };
 
 bool IsCTypesGlobal(HandleValue v);
 bool IsCTypesGlobal(JSObject* obj);
 
-const JSCTypesCallbacks* GetCallbacks(JSObject* obj);
+JSCTypesCallbacks* GetCallbacks(JSObject* obj);
 
 /*******************************************************************************
 ** JSClass reserved slot definitions
 *******************************************************************************/
 
 enum CTypesGlobalSlot {
   SLOT_CALLBACKS = 0, // pointer to JSCTypesCallbacks struct
   SLOT_ERRNO = 1,     // jsval for latest |errno|
@@ -456,17 +456,17 @@ namespace CType {
   size_t GetSize(JSObject* obj);
   bool GetSafeSize(JSObject* obj, size_t* result);
   bool IsSizeDefined(JSObject* obj);
   size_t GetAlignment(JSObject* obj);
   ffi_type* GetFFIType(JSContext* cx, JSObject* obj);
   JSString* GetName(JSContext* cx, HandleObject obj);
   JSObject* GetProtoFromCtor(JSObject* obj, CTypeProtoSlot slot);
   JSObject* GetProtoFromType(JSContext* cx, JSObject* obj, CTypeProtoSlot slot);
-  const JSCTypesCallbacks* GetCallbacksFromType(JSObject* obj);
+  JSCTypesCallbacks* GetCallbacksFromType(JSObject* obj);
 }
 
 namespace PointerType {
   JSObject* CreateInternal(JSContext* cx, HandleObject baseType);
 
   JSObject* GetBaseType(JSObject* obj);
 }
 
--- a/js/src/ctypes/Library.cpp
+++ b/js/src/ctypes/Library.cpp
@@ -75,17 +75,17 @@ Library::Name(JSContext* cx, unsigned ar
   if (!result)
     return false;
 
   args.rval().setString(result);
   return true;
 }
 
 JSObject*
-Library::Create(JSContext* cx, jsval path_, const JSCTypesCallbacks* callbacks)
+Library::Create(JSContext* cx, jsval path_, JSCTypesCallbacks* callbacks)
 {
   RootedValue path(cx, path_);
   RootedObject libraryObj(cx,
                           JS_NewObject(cx, &sLibraryClass, NullPtr(), NullPtr()));
   if (!libraryObj)
     return nullptr;
 
   // initialize the library
--- a/js/src/ctypes/Library.h
+++ b/js/src/ctypes/Library.h
@@ -18,17 +18,17 @@ enum LibrarySlot {
   SLOT_LIBRARY = 0,
   LIBRARY_SLOTS
 };
 
 namespace Library
 {
   bool Name(JSContext* cx, unsigned argc, JS::Value *vp);
 
-  JSObject* Create(JSContext* cx, JS::Value path, const JSCTypesCallbacks* callbacks);
+  JSObject* Create(JSContext* cx, JS::Value path, JSCTypesCallbacks* callbacks);
 
   bool IsLibrary(JSObject* obj);
   PRLibrary* GetLibrary(JSObject* obj);
 
   bool Open(JSContext* cx, unsigned argc, JS::Value* vp);
 }
 
 }
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -5936,23 +5936,23 @@ JS_SetDefaultLocale(JSRuntime *rt, const
 JS_PUBLIC_API(void)
 JS_ResetDefaultLocale(JSRuntime *rt)
 {
     AssertHeapIsIdle(rt);
     rt->resetDefaultLocale();
 }
 
 JS_PUBLIC_API(void)
-JS_SetLocaleCallbacks(JSRuntime *rt, const JSLocaleCallbacks *callbacks)
+JS_SetLocaleCallbacks(JSRuntime *rt, JSLocaleCallbacks *callbacks)
 {
     AssertHeapIsIdle(rt);
     rt->localeCallbacks = callbacks;
 }
 
-JS_PUBLIC_API(const JSLocaleCallbacks *)
+JS_PUBLIC_API(JSLocaleCallbacks *)
 JS_GetLocaleCallbacks(JSRuntime *rt)
 {
     /* This function can be called by a finalizer. */
     return rt->localeCallbacks;
 }
 
 /************************************************************************/
 
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -1923,17 +1923,17 @@ typedef struct JSCTypesCallbacks JSCType
 
 /*
  * Set the callbacks on the provided 'ctypesObj' object. 'callbacks' should be a
  * pointer to static data that exists for the lifetime of 'ctypesObj', but it
  * may safely be altered after calling this function and without having
  * to call this function again.
  */
 extern JS_PUBLIC_API(void)
-JS_SetCTypesCallbacks(JSObject *ctypesObj, const JSCTypesCallbacks *callbacks);
+JS_SetCTypesCallbacks(JSObject *ctypesObj, JSCTypesCallbacks *callbacks);
 #endif
 
 typedef bool
 (* JSEnumerateDiagnosticMemoryCallback)(void *ptr, size_t length);
 
 /*
  * Enumerate memory regions that contain diagnostic information
  * intended to be included in crash report minidumps.
@@ -4689,23 +4689,23 @@ struct JSLocaleCallbacks {
     JSLocaleToUnicode       localeToUnicode;
 };
 
 /*
  * Establish locale callbacks. The pointer must persist as long as the
  * JSRuntime.  Passing nullptr restores the default behaviour.
  */
 extern JS_PUBLIC_API(void)
-JS_SetLocaleCallbacks(JSRuntime *rt, const JSLocaleCallbacks *callbacks);
+JS_SetLocaleCallbacks(JSRuntime *rt, JSLocaleCallbacks *callbacks);
 
 /*
  * Return the address of the current locale callbacks struct, which may
  * be nullptr.
  */
-extern JS_PUBLIC_API(const JSLocaleCallbacks *)
+extern JS_PUBLIC_API(JSLocaleCallbacks *)
 JS_GetLocaleCallbacks(JSRuntime *rt);
 
 /************************************************************************/
 
 /*
  * Error reporting.
  */
 
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -803,17 +803,17 @@ struct JSRuntime : public JS::shadow::Ru
     bool exclusiveThreadsPresent() const {
         return numExclusiveThreads > 0;
     }
 
     /* How many compartments there are across all zones. */
     size_t              numCompartments;
 
     /* Locale-specific callbacks for string conversion. */
-    const JSLocaleCallbacks *localeCallbacks;
+    JSLocaleCallbacks *localeCallbacks;
 
     /* Default locale for Internationalization API */
     char *defaultLocale;
 
     /* Default JSVersion. */
     JSVersion defaultVersion_;
 
     /* Futex API, if installed */
--- a/js/xpconnect/src/XPCLocale.cpp
+++ b/js/xpconnect/src/XPCLocale.cpp
@@ -55,26 +55,26 @@ struct XPCLocaleCallbacks : public JSLoc
    * Return the XPCLocaleCallbacks that's hidden away in |rt|. (This impl uses
    * the locale callbacks struct to store away its per-runtime data.)
    */
   static XPCLocaleCallbacks*
   This(JSRuntime *rt)
   {
     // Locale information for |rt| was associated using xpc_LocalizeRuntime;
     // assert and double-check this.
-    const JSLocaleCallbacks* lc = JS_GetLocaleCallbacks(rt);
+    JSLocaleCallbacks* lc = JS_GetLocaleCallbacks(rt);
     MOZ_ASSERT(lc);
     MOZ_ASSERT(lc->localeToUpperCase == LocaleToUpperCase);
     MOZ_ASSERT(lc->localeToLowerCase == LocaleToLowerCase);
     MOZ_ASSERT(lc->localeCompare == LocaleCompare);
     MOZ_ASSERT(lc->localeToUnicode == LocaleToUnicode);
 
-    const XPCLocaleCallbacks* ths = static_cast<const XPCLocaleCallbacks*>(lc);
+    XPCLocaleCallbacks* ths = static_cast<XPCLocaleCallbacks*>(lc);
     ths->AssertThreadSafety();
-    return const_cast<XPCLocaleCallbacks*>(ths);
+    return ths;
   }
 
   static bool
   LocaleToUpperCase(JSContext *cx, HandleString src, MutableHandleValue rval)
   {
     return ChangeCase(cx, src, rval, ToUpperCase);
   }
 
@@ -228,17 +228,17 @@ private:
         JS_free(cx, unichars);
       }
     }
 
     xpc::Throw(cx, NS_ERROR_OUT_OF_MEMORY);
     return false;
   }
 
-  void AssertThreadSafety() const
+  void AssertThreadSafety()
   {
     MOZ_ASSERT(mThread == PR_GetCurrentThread(),
                "XPCLocaleCallbacks used unsafely!");
   }
 
   nsCOMPtr<nsICollation> mCollation;
   nsCOMPtr<nsIUnicodeDecoder> mDecoder;
 #ifdef DEBUG
@@ -268,12 +268,12 @@ xpc_LocalizeRuntime(JSRuntime *rt)
   NS_LossyConvertUTF16toASCII locale(localeStr);
 
   return !!JS_SetDefaultLocale(rt, locale.get());
 }
 
 void
 xpc_DelocalizeRuntime(JSRuntime *rt)
 {
-  const XPCLocaleCallbacks* lc = XPCLocaleCallbacks::This(rt);
+  XPCLocaleCallbacks* lc = XPCLocaleCallbacks::This(rt);
   JS_SetLocaleCallbacks(rt, nullptr);
   delete lc;
 }