Bug 1237151 (part 3) - Remove ignored qualifiers in all remaining code. r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 05 Jan 2016 17:08:45 -0800
changeset 279103 fd2b9869729288b7e236410a45b45e80ba4c7ad6
parent 279102 729e181c80897c948337afaa7f49484b29f88ea8
child 279104 01908255691fb869756ce0e16caea539e2a87bd6
push id29867
push usercbook@mozilla.com
push dateFri, 08 Jan 2016 11:00:43 +0000
treeherdermozilla-central@1424cdfc075d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1237151
milestone46.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 1237151 (part 3) - Remove ignored qualifiers in all remaining code. r=froydnj.
docshell/base/timeline/AbstractTimelineMarker.h
dom/gamepad/cocoa/CocoaGamepad.cpp
dom/inputport/InputPortData.cpp
dom/inputport/InputPortData.h
dom/media/android/AndroidMediaDecoder.h
dom/media/omx/OMXCodecWrapper.cpp
dom/notification/Notification.h
dom/plugins/ipc/PluginMessageUtils.h
dom/presentation/provider/MulticastDNSDeviceProvider.h
dom/smil/nsSMILCSSValueType.cpp
dom/svg/SVGTransform.h
embedding/components/printingui/unixshared/nsPrintingPromptService.cpp
gfx/layers/Layers.cpp
gfx/layers/Layers.h
gfx/thebes/gfxUtils.cpp
ipc/chromium/src/chrome/common/ipc_message.h
ipc/chromium/src/chrome/common/ipc_message_utils.h
ipc/ipdl/ipdl/lower.py
layout/base/nsPresContext.h
layout/generic/nsGridContainerFrame.cpp
mozglue/linker/Mappable.h
mozglue/linker/SeekableZStream.h
netwerk/cache2/CacheObserver.cpp
netwerk/cache2/CacheObserver.h
netwerk/cache2/CacheStorageService.cpp
netwerk/cache2/CacheStorageService.h
parser/htmlparser/nsParser.cpp
storage/mozStorageBindingParamsArray.h
toolkit/components/osfile/NativeOSFileInternals.cpp
toolkit/mozapps/update/updater/automounter_gonk.h
tools/profiler/lul/LulCommon.cpp
tools/profiler/lul/LulCommonExt.h
tools/profiler/lul/LulDwarf.cpp
tools/profiler/lul/LulDwarfExt.h
widget/gtk/nsPrintDialogGTK.cpp
xpcom/build/PoisonIOInterposerBase.cpp
xpcom/ds/nsIAtom.idl
xpcom/glue/PLDHashTable.h
xpcom/glue/nsTArray.h
--- a/docshell/base/timeline/AbstractTimelineMarker.h
+++ b/docshell/base/timeline/AbstractTimelineMarker.h
@@ -44,18 +44,18 @@ public:
 
   virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) = 0;
   virtual JSObject* GetStack() = 0;
 
   const char* GetName() const { return mName; }
   DOMHighResTimeStamp GetTime() const { return mTime; }
   MarkerTracingType GetTracingType() const { return mTracingType; }
 
-  const uint8_t GetProcessType() const { return mProcessType; };
-  const bool IsOffMainThread() const { return mIsOffMainThread; };
+  uint8_t GetProcessType() const { return mProcessType; };
+  bool IsOffMainThread() const { return mIsOffMainThread; };
 
 private:
   const char* mName;
   DOMHighResTimeStamp mTime;
   MarkerTracingType mTracingType;
 
   uint8_t mProcessType; // @see `enum GeckoProcessType`.
   bool mIsOffMainThread;
--- a/dom/gamepad/cocoa/CocoaGamepad.cpp
+++ b/dom/gamepad/cocoa/CocoaGamepad.cpp
@@ -88,17 +88,17 @@ class Gamepad {
   }
   void init(IOHIDDeviceRef device);
   size_t numButtons() { return buttons.Length() + (mDpad ? 4 : 0); }
   size_t numAxes() { return axes.Length(); }
 
   // Index given by our superclass.
   uint32_t mSuperIndex;
 
-  const bool isDpad(IOHIDElementRef element) const
+  bool isDpad(IOHIDElementRef element) const
   {
     return element == mDpad;
   }
 
   const dpad_buttons& getDpadState() const
   {
     return mDpadState;
   }
--- a/dom/inputport/InputPortData.cpp
+++ b/dom/inputport/InputPortData.cpp
@@ -98,16 +98,16 @@ InputPortData::SetConnected(const bool a
 }
 
 const nsString&
 InputPortData::GetId() const
 {
   return mId;
 }
 
-const InputPortType
+InputPortType
 InputPortData::GetType() const
 {
   return ToInputPortType(mType);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/inputport/InputPortData.h
+++ b/dom/inputport/InputPortData.h
@@ -28,17 +28,17 @@ class InputPortData final : public nsIIn
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIINPUTPORTDATA
 
   InputPortData();
 
   const nsString& GetId() const;
 
-  const InputPortType GetType() const;
+  InputPortType GetType() const;
 
 private:
   ~InputPortData();
 
   nsString mId;
   nsString mType;
   bool mIsConnected;
 };
--- a/dom/media/android/AndroidMediaDecoder.h
+++ b/dom/media/android/AndroidMediaDecoder.h
@@ -12,17 +12,17 @@
 namespace mozilla {
 
 class AndroidMediaDecoder : public MediaDecoder
 {
   nsCString mType;
 public:
   AndroidMediaDecoder(MediaDecoderOwner* aOwner, const nsACString& aType);
 
-  const nsresult GetContentType(nsACString& aType) const {
+  nsresult GetContentType(nsACString& aType) const {
     aType = mType;
     return NS_OK;
   }
 
   virtual MediaDecoder* Clone(MediaDecoderOwner* aOwner) {
     return new AndroidMediaDecoder(aOwner, mType);
   }
   virtual MediaDecoderStateMachine* CreateStateMachine();
--- a/dom/media/omx/OMXCodecWrapper.cpp
+++ b/dom/media/omx/OMXCodecWrapper.cpp
@@ -800,31 +800,31 @@ public:
     size_t bytesToCopy = SendSilenceToBuffer(1);
     IncreaseOffset(bytesToCopy);
     *aSamplesRead = 1;
   }
 
 private:
   uint8_t* GetPointer() { return mData + mOffset; }
 
-  const size_t AvailableSize() { return mCapicity - mOffset; }
+  size_t AvailableSize() const { return mCapicity - mOffset; }
 
   void IncreaseOffset(size_t aValue)
   {
     // Should never out of bound.
     MOZ_ASSERT(mOffset + aValue <= mCapicity);
     mOffset += aValue;
   }
 
-  bool IsEmpty()
+  bool IsEmpty() const
   {
     return (mOffset == 0);
   }
 
-  const size_t GetCapacity()
+  size_t GetCapacity() const
   {
     return mCapicity;
   }
 
   // Update buffer offset, timestamp and the total number of copied samples.
   void UpdateAfterSendChunk(size_t aSamplesNum, size_t aBytesToCopy,
                             size_t* aSourceSamplesCopied)
   {
--- a/dom/notification/Notification.h
+++ b/dom/notification/Notification.h
@@ -339,17 +339,17 @@ protected:
       return NS_LITERAL_STRING("ltr");
     case NotificationDirection::Rtl:
       return NS_LITERAL_STRING("rtl");
     default:
       return NS_LITERAL_STRING("auto");
     }
   }
 
-  static const NotificationDirection StringToDirection(const nsAString& aDirection)
+  static NotificationDirection StringToDirection(const nsAString& aDirection)
   {
     if (aDirection.EqualsLiteral("ltr")) {
       return NotificationDirection::Ltr;
     }
     if (aDirection.EqualsLiteral("rtl")) {
       return NotificationDirection::Rtl;
     }
     return NotificationDirection::Auto;
--- a/dom/plugins/ipc/PluginMessageUtils.h
+++ b/dom/plugins/ipc/PluginMessageUtils.h
@@ -115,17 +115,17 @@ typedef HANDLE DXGISharedSurfaceHandle;
 #else
 typedef mozilla::null_t WindowsSharedMemoryHandle;
 typedef mozilla::null_t DXGISharedSurfaceHandle;
 #endif
 
 // XXX maybe not the best place for these. better one?
 
 #define VARSTR(v_)  case v_: return #v_
-inline const char* const
+inline const char*
 NPPVariableToString(NPPVariable aVar)
 {
     switch (aVar) {
         VARSTR(NPPVpluginNameString);
         VARSTR(NPPVpluginDescriptionString);
         VARSTR(NPPVpluginWindowBool);
         VARSTR(NPPVpluginTransparentBool);
         VARSTR(NPPVjavaClass);
--- a/dom/presentation/provider/MulticastDNSDeviceProvider.h
+++ b/dom/presentation/provider/MulticastDNSDeviceProvider.h
@@ -81,22 +81,22 @@ private:
       return mId;
     }
 
     const nsCString& Address() const
     {
       return mAddress;
     }
 
-    const uint16_t Port() const
+    uint16_t Port() const
     {
       return mPort;
     }
 
-    const DeviceState State() const
+    DeviceState State() const
     {
       return mState;
     }
 
     void ChangeState(DeviceState aState)
     {
       mState = aState;
     }
--- a/dom/smil/nsSMILCSSValueType.cpp
+++ b/dom/smil/nsSMILCSSValueType.cpp
@@ -67,17 +67,17 @@ GetZeroValueForUnit(StyleAnimationValue:
 // If one argument is null, this method updates it to point to "zero"
 // for the other argument's Unit (if applicable; otherwise, we return false).
 //
 // If neither argument is null, this method generally does nothing, though it
 // may apply a workaround for the special case where a 0 length-value is mixed
 // with a eUnit_Float value.  (See comment below.)
 //
 // Returns true on success, or false.
-static const bool
+static bool
 FinalizeStyleAnimationValues(const StyleAnimationValue*& aValue1,
                              const StyleAnimationValue*& aValue2)
 {
   MOZ_ASSERT(aValue1 || aValue2,
              "expecting at least one non-null value");
 
   // Are we missing either val? (If so, it's an implied 0 in other val's units)
   if (!aValue1) {
--- a/dom/svg/SVGTransform.h
+++ b/dom/svg/SVGTransform.h
@@ -129,17 +129,17 @@ public:
   void SetSkewX(float angle, ErrorResult& rv);
   void SetSkewY(float angle, ErrorResult& rv);
 
 protected:
   ~SVGTransform();
 
   // Interface for SVGMatrix's use
   friend class dom::SVGMatrix;
-  const bool IsAnimVal() const {
+  bool IsAnimVal() const {
     return mIsAnimValItem;
   }
   const gfxMatrix& Matrixgfx() const {
     return Transform().GetMatrix();
   }
   void SetMatrix(const gfxMatrix& aMatrix);
 
 private:
--- a/embedding/components/printingui/unixshared/nsPrintingPromptService.cpp
+++ b/embedding/components/printingui/unixshared/nsPrintingPromptService.cpp
@@ -38,17 +38,17 @@ public:
     ~ParamBlock() 
     {
         NS_IF_RELEASE(mBlock);
     }
     nsresult Init() {
       return CallCreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID, &mBlock);
     }
     nsIDialogParamBlock * operator->() const MOZ_NO_ADDREF_RELEASE_ON_RETURN { return mBlock; }
-    operator nsIDialogParamBlock * const ()  { return mBlock; }
+    operator nsIDialogParamBlock * () const { return mBlock; }
 
 private:
     nsIDialogParamBlock *mBlock;
 };
 
 /****************************************************************
  ***************** nsPrintingPromptService **********************
  ****************************************************************/
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -936,17 +936,17 @@ Layer::ApplyPendingUpdatesForThisTransac
   if (mPendingAnimations) {
     MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) PendingUpdatesForThisTransaction", this));
     mPendingAnimations->SwapElements(mAnimations);
     mPendingAnimations = nullptr;
     Mutated();
   }
 }
 
-const float
+float
 Layer::GetLocalOpacity()
 {
   float opacity = mOpacity;
   if (LayerComposite* shadow = AsLayerComposite())
     opacity = shadow->GetShadowOpacity();
   return std::min(std::max(opacity, 0.0f), 1.0f);
 }
 
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -1349,17 +1349,17 @@ public:
    * for shadow layers, GetShadowTransform()
    */
   const gfx::Matrix4x4 GetLocalTransform();
 
   /**
    * Returns the local opacity for this layer: either mOpacity or,
    * for shadow layers, GetShadowOpacity()
    */
-  const float GetLocalOpacity();
+  float GetLocalOpacity();
 
   /**
    * DRAWING PHASE ONLY
    *
    * Apply pending changes to layers before drawing them, if those
    * pending changes haven't been overridden by later changes.
    */
   void ApplyPendingUpdatesToSubtree();
@@ -1632,17 +1632,17 @@ public:
 
   static bool IsLogEnabled() { return LayerManager::IsLogEnabled(); }
 
   /**
    * Returns the current area of the layer (in layer-space coordinates)
    * marked as needed to be recomposited.
    */
   const nsIntRegion& GetInvalidRegion() { return mInvalidRegion; }
-  const void AddInvalidRegion(const nsIntRegion& aRegion) {
+  void AddInvalidRegion(const nsIntRegion& aRegion) {
     mInvalidRegion.Or(mInvalidRegion, aRegion);
   }
 
   /**
    * Mark the entirety of the layer's visible region as being invalid.
    */
   void SetInvalidRectToVisibleRegion() { mInvalidRegion = GetVisibleRegion().ToUnknownRegion(); }
 
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -87,21 +87,21 @@ void mozilla_dump_image(void* bytes, int
         Factory::CreateWrappingDataSourceSurface((uint8_t*)bytes, strideBytes,
                                                  IntSize(width, height),
                                                  format);
     gfxUtils::DumpAsDataURI(surf);
 }
 
 }
 
-static const uint8_t PremultiplyValue(uint8_t a, uint8_t v) {
+static uint8_t PremultiplyValue(uint8_t a, uint8_t v) {
     return gfxUtils::sPremultiplyTable[a*256+v];
 }
 
-static const uint8_t UnpremultiplyValue(uint8_t a, uint8_t v) {
+static uint8_t UnpremultiplyValue(uint8_t a, uint8_t v) {
     return gfxUtils::sUnpremultiplyTable[a*256+v];
 }
 
 static void
 PremultiplyData(const uint8_t* srcData,
                 size_t srcStride,  // row-to-row stride in bytes
                 uint8_t* destData,
                 size_t destStride, // row-to-row stride in bytes
--- a/ipc/chromium/src/chrome/common/ipc_message.h
+++ b/ipc/chromium/src/chrome/common/ipc_message.h
@@ -189,17 +189,17 @@ class Message : public Pickle {
   int32_t seqno() const {
     return header()->seqno;
   }
 
   void set_seqno(int32_t aSeqno) {
     header()->seqno = aSeqno;
   }
 
-  const char* const name() const {
+  const char* name() const {
     return name_;
   }
 
   void set_name(const char* const aName) {
     name_ = aName;
   }
 
 #if defined(OS_POSIX)
--- a/ipc/chromium/src/chrome/common/ipc_message_utils.h
+++ b/ipc/chromium/src/chrome/common/ipc_message_utils.h
@@ -48,17 +48,17 @@ class MessageIterator {
     return val;
   }
   const std::wstring NextWString() const {
     std::wstring val;
     if (!msg_.ReadWString(&iter_, &val))
       NOTREACHED();
     return val;
   }
-  const void NextData(const char** data, int* length) const {
+  void NextData(const char** data, int* length) const {
     if (!msg_.ReadData(&iter_, data, length)) {
       NOTREACHED();
     }
   }
  private:
   const Message& msg_;
   mutable void* iter_;
 };
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -572,17 +572,17 @@ def _cxxPtrToType(ipdltype, side):
 
 def _cxxConstPtrToType(ipdltype, side):
     t = _cxxBareType(ipdltype, side)
     if ipdltype.isIPDL() and ipdltype.isActor():
         t.ptr = 0
         t.ptrconstptr = 1
         return t
     t.const = 1
-    t.ptrconst = 1
+    t.ptr = 1
     return t
 
 def _allocMethod(ptype, side):
     return ExprVar('Alloc'+ str(Actor(ptype, side)))
 
 def _deallocMethod(ptype, side):
     return ExprVar('Dealloc'+ str(Actor(ptype, side)))
 
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -398,28 +398,28 @@ public:
     }
 
     return false;
   }
 
   /**
    * Get the default colors
    */
-  const nscolor DefaultColor() const { return mDefaultColor; }
-  const nscolor DefaultBackgroundColor() const { return mBackgroundColor; }
-  const nscolor DefaultLinkColor() const { return mLinkColor; }
-  const nscolor DefaultActiveLinkColor() const { return mActiveLinkColor; }
-  const nscolor DefaultVisitedLinkColor() const { return mVisitedLinkColor; }
-  const nscolor FocusBackgroundColor() const { return mFocusBackgroundColor; }
-  const nscolor FocusTextColor() const { return mFocusTextColor; }
+  nscolor DefaultColor() const { return mDefaultColor; }
+  nscolor DefaultBackgroundColor() const { return mBackgroundColor; }
+  nscolor DefaultLinkColor() const { return mLinkColor; }
+  nscolor DefaultActiveLinkColor() const { return mActiveLinkColor; }
+  nscolor DefaultVisitedLinkColor() const { return mVisitedLinkColor; }
+  nscolor FocusBackgroundColor() const { return mFocusBackgroundColor; }
+  nscolor FocusTextColor() const { return mFocusTextColor; }
 
   /**
    * Body text color, for use in quirks mode only.
    */
-  const nscolor BodyTextColor() const { return mBodyTextColor; }
+  nscolor BodyTextColor() const { return mBodyTextColor; }
   void SetBodyTextColor(nscolor aColor) { mBodyTextColor = aColor; }
 
   bool GetUseFocusColors() const { return mUseFocusColors; }
   uint8_t FocusRingWidth() const { return mFocusRingWidth; }
   bool GetFocusRingOnAnything() const { return mFocusRingOnAnything; }
   uint8_t GetFocusRingStyle() const { return mFocusRingStyle; }
 
   void SetContainer(nsIDocShell* aContainer);
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -316,17 +316,17 @@ private:
       }
     }
     MOZ_ASSERT(nth > 0, "should have returned a valid line above already");
     *aNth = nth;
     return 0;
   }
 
   // Return true if aName exists at aIndex.
-  const bool Contains(uint32_t aIndex, const nsString& aName) const
+  bool Contains(uint32_t aIndex, const nsString& aName) const
   {
     if (!mHasRepeatAuto) {
       return mLineNameLists[aIndex].Contains(aName);
     }
     if (aIndex < mRepeatAutoEnd && aIndex >= mRepeatAutoStart &&
         mRepeatAutoLineNameListBefore.Contains(aName)) {
       return true;
     }
--- a/mozglue/linker/Mappable.h
+++ b/mozglue/linker/Mappable.h
@@ -234,28 +234,28 @@ private:
 
     /* Returns addr + length, as a pointer */
     const void *end() const {
       return reinterpret_cast<const void *>
              (reinterpret_cast<const unsigned char *>(addr) + length);
     }
 
     /* Returns offset + length */
-    const off_t endOffset() const {
+    off_t endOffset() const {
       return offset + length;
     }
 
     /* Returns the offset corresponding to the given address */
-    const off_t offsetOf(const void *ptr) const {
+    off_t offsetOf(const void *ptr) const {
       return reinterpret_cast<uintptr_t>(ptr)
              - reinterpret_cast<uintptr_t>(addr) + offset;
     }
 
     /* Returns whether the given address is in the LazyMap range */
-    const bool Contains(const void *ptr) const {
+    bool Contains(const void *ptr) const {
       return (ptr >= addr) && (ptr < end());
     }
   };
 
   /* List of all mappings */
   std::vector<LazyMap> lazyMaps;
 
   /* Array keeping track of which chunks have already been decompressed.
--- a/mozglue/linker/SeekableZStream.h
+++ b/mozglue/linker/SeekableZStream.h
@@ -72,28 +72,28 @@ public:
   bool Decompress(void *where, size_t chunk, size_t length = 0);
 
   /* Decompresses the given chunk at the given address. If a length is given,
    * only decompresses that amount of data instead of the entire chunk.
    * Returns whether decompression succeeded (true) or failed (false). */
   bool DecompressChunk(void *where, size_t chunk, size_t length = 0);
  
   /* Returns the uncompressed size of the complete zstream */
-  const size_t GetUncompressedSize() const
+  size_t GetUncompressedSize() const
   {
     return (offsetTable.numElements() - 1) * chunkSize + lastChunkSize;
   }
 
   /* Returns the chunk size of the given chunk */
-  const size_t GetChunkSize(size_t chunk = 0) const {
+  size_t GetChunkSize(size_t chunk = 0) const {
     return (chunk == offsetTable.numElements() - 1) ? lastChunkSize : chunkSize;
   }
 
   /* Returns the number of chunks */
-  const size_t GetChunksNum() const {
+  size_t GetChunksNum() const {
     return offsetTable.numElements();
   }
 
   /**
    * Filters used to improve compression rate.
    */
   enum FilterDirection {
     FILTER,
--- a/netwerk/cache2/CacheObserver.cpp
+++ b/netwerk/cache2/CacheObserver.cpp
@@ -235,17 +235,17 @@ CacheObserver::AttachToPreferences()
 
   mozilla::Preferences::AddBoolVarCache(
     &sSanitizeOnShutdown, "privacy.sanitize.sanitizeOnShutdown", kDefaultSanitizeOnShutdown);
   mozilla::Preferences::AddBoolVarCache(
     &sClearCacheOnShutdown, "privacy.clearOnShutdown.cache", kDefaultClearCacheOnShutdown);
 }
 
 // static
-uint32_t const CacheObserver::MemoryCacheCapacity()
+uint32_t CacheObserver::MemoryCacheCapacity()
 {
   if (sMemoryCacheCapacity >= 0)
     return sMemoryCacheCapacity << 10;
 
   if (sAutoMemoryCacheCapacity != -1)
     return sAutoMemoryCacheCapacity;
 
   static uint64_t bytes = PR_GetPhysicalMemorySize();
@@ -273,17 +273,17 @@ uint32_t const CacheObserver::MemoryCach
     capacity <<= 20;
   }
 
   // Result is in bytes.
   return sAutoMemoryCacheCapacity = capacity;
 }
 
 // static
-bool const CacheObserver::UseNewCache()
+bool CacheObserver::UseNewCache()
 {
   uint32_t useNewCache = sUseNewCache;
 
   if (sUseNewCacheTemp)
     useNewCache = 1;
 
   switch (useNewCache) {
     case 0: // use the old cache backend
@@ -436,17 +436,17 @@ nsresult Run(NeckoOriginAttributes const
 
   return NS_OK;
 }
 
 } // CacheStorageEvictHelper
 } // anon
 
 // static
-bool const CacheObserver::EntryIsTooBig(int64_t aSize, bool aUsingDisk)
+bool CacheObserver::EntryIsTooBig(int64_t aSize, bool aUsingDisk)
 {
   // If custom limit is set, check it.
   int64_t preferredLimit = aUsingDisk ? sMaxDiskEntrySize : sMaxMemoryEntrySize;
 
   // do not convert to bytes when the limit is -1, which means no limit
   if (preferredLimit > 0) {
     preferredLimit <<= 10;
   }
--- a/netwerk/cache2/CacheObserver.h
+++ b/netwerk/cache2/CacheObserver.h
@@ -22,59 +22,59 @@ class CacheObserver : public nsIObserver
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   static nsresult Init();
   static nsresult Shutdown();
   static CacheObserver* Self() { return sSelf; }
 
   // Access to preferences
-  static bool const UseNewCache();
-  static bool const UseDiskCache()
+  static bool UseNewCache();
+  static bool UseDiskCache()
     { return sUseDiskCache; }
-  static bool const UseMemoryCache()
+  static bool UseMemoryCache()
     { return sUseMemoryCache; }
-  static uint32_t const MetadataMemoryLimit() // result in bytes.
+  static uint32_t MetadataMemoryLimit() // result in bytes.
     { return sMetadataMemoryLimit << 10; }
-  static uint32_t const MemoryCacheCapacity(); // result in bytes.
-  static uint32_t const DiskCacheCapacity() // result in bytes.
+  static uint32_t MemoryCacheCapacity(); // result in bytes.
+  static uint32_t DiskCacheCapacity() // result in bytes.
     { return sDiskCacheCapacity << 10; }
   static void SetDiskCacheCapacity(uint32_t); // parameter in bytes.
-  static uint32_t const DiskFreeSpaceSoftLimit() // result in bytes.
+  static uint32_t DiskFreeSpaceSoftLimit() // result in bytes.
     { return sDiskFreeSpaceSoftLimit << 10; }
-  static uint32_t const DiskFreeSpaceHardLimit() // result in bytes.
+  static uint32_t DiskFreeSpaceHardLimit() // result in bytes.
     { return sDiskFreeSpaceHardLimit << 10; }
-  static bool const SmartCacheSizeEnabled()
+  static bool SmartCacheSizeEnabled()
     { return sSmartCacheSizeEnabled; }
-  static uint32_t const PreloadChunkCount()
+  static uint32_t PreloadChunkCount()
     { return sPreloadChunkCount; }
-  static uint32_t const MaxMemoryEntrySize() // result in bytes.
+  static uint32_t MaxMemoryEntrySize() // result in bytes.
     { return sMaxMemoryEntrySize << 10; }
-  static uint32_t const MaxDiskEntrySize() // result in bytes.
+  static uint32_t MaxDiskEntrySize() // result in bytes.
     { return sMaxDiskEntrySize << 10; }
-  static uint32_t const MaxDiskChunksMemoryUsage(bool aPriority) // result in bytes.
+  static uint32_t MaxDiskChunksMemoryUsage(bool aPriority) // result in bytes.
     { return aPriority ? sMaxDiskPriorityChunksMemoryUsage << 10
                        : sMaxDiskChunksMemoryUsage << 10; }
-  static uint32_t const CompressionLevel()
+  static uint32_t CompressionLevel()
     { return sCompressionLevel; }
-  static uint32_t const HalfLifeSeconds()
+  static uint32_t HalfLifeSeconds()
     { return sHalfLifeHours * 60.0F * 60.0F; }
-  static int32_t const HalfLifeExperiment()
+  static int32_t HalfLifeExperiment()
     { return sHalfLifeExperiment; }
-  static bool const ClearCacheOnShutdown()
+  static bool ClearCacheOnShutdown()
     { return sSanitizeOnShutdown && sClearCacheOnShutdown; }
-  static bool const CacheFSReported()
+  static bool CacheFSReported()
     { return sCacheFSReported; }
   static void SetCacheFSReported();
-  static bool const HashStatsReported()
+  static bool HashStatsReported()
     { return sHashStatsReported; }
   static void SetHashStatsReported();
   static void ParentDirOverride(nsIFile ** aDir);
 
-  static bool const EntryIsTooBig(int64_t aSize, bool aUsingDisk);
+  static bool EntryIsTooBig(int64_t aSize, bool aUsingDisk);
 
 private:
   static CacheObserver* sSelf;
 
   void StoreDiskCacheCapacity();
   void StoreCacheFSReported();
   void StoreHashStatsReported();
   void AttachToPreferences();
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -83,17 +83,17 @@ CacheStorageService::MemoryPool::MemoryP
 
 CacheStorageService::MemoryPool::~MemoryPool()
 {
   if (mMemorySize != 0) {
     NS_ERROR("Network cache reported memory consumption is not at 0, probably leaking?");
   }
 }
 
-uint32_t const
+uint32_t
 CacheStorageService::MemoryPool::Limit() const
 {
   switch (mType) {
   case DISK:
     return CacheObserver::MetadataMemoryLimit();
   case MEMORY:
     return CacheObserver::MemoryCacheCapacity();
   }
--- a/netwerk/cache2/CacheStorageService.h
+++ b/netwerk/cache2/CacheStorageService.h
@@ -319,17 +319,17 @@ private:
      * Purges entries from memory based on the frecency ordered array.
      */
     void PurgeOverMemoryLimit();
     void PurgeExpired();
     void PurgeByFrecency(bool &aFrecencyNeedsSort, uint32_t aWhat);
     void PurgeAll(uint32_t aWhat);
 
   private:
-    uint32_t const Limit() const;
+    uint32_t Limit() const;
     MemoryPool() = delete;
   };
 
   MemoryPool mDiskPool;
   MemoryPool mMemoryPool;
   MemoryPool& Pool(bool aUsingDisk)
   {
     return aUsingDisk ? mDiskPool : mMemoryPool;
--- a/parser/htmlparser/nsParser.cpp
+++ b/parser/htmlparser/nsParser.cpp
@@ -1679,17 +1679,17 @@ ExtractCharsetFromXmlDeclaration(const u
           }
         }
       } // if (!versionFound)
     } // for
   }
   return !oCharset.IsEmpty();
 }
 
-inline const char
+inline char
 GetNextChar(nsACString::const_iterator& aStart,
             nsACString::const_iterator& aEnd)
 {
   NS_ASSERTION(aStart != aEnd, "end of buffer");
   return (++aStart != aEnd) ? *aStart : '\0';
 }
 
 static NS_METHOD
--- a/storage/mozStorageBindingParamsArray.h
+++ b/storage/mozStorageBindingParamsArray.h
@@ -41,17 +41,17 @@ public:
   /**
    * @return the pointer to the owning BindingParamsArray.
    */
   const StorageBaseStatementInternal *getOwner() const;
 
   /**
    * @return the number of elemets the array contains.
    */
-  const size_type length() const { return mArray.Length(); }
+  size_type length() const { return mArray.Length(); }
 
   class iterator {
   public:
     iterator(BindingParamsArray *aArray,
              uint32_t aIndex)
     : mArray(aArray)
     , mIndex(aIndex)
     {
--- a/toolkit/components/osfile/NativeOSFileInternals.cpp
+++ b/toolkit/components/osfile/NativeOSFileInternals.cpp
@@ -79,17 +79,17 @@ struct ArrayBufferContents {
  * RAII for ArrayBufferContents.
  */
 struct ScopedArrayBufferContentsTraits {
   typedef ArrayBufferContents type;
   const static type empty() {
     type result = {0, 0};
     return result;
   }
-  const static void release(type ptr) {
+  static void release(type ptr) {
     js_free(ptr.data);
     ptr.data = nullptr;
     ptr.nbytes = 0;
   }
 };
 
 struct MOZ_NON_TEMPORARY_CLASS ScopedArrayBufferContents: public Scoped<ScopedArrayBufferContentsTraits> {
   explicit ScopedArrayBufferContents(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM):
--- a/toolkit/mozapps/update/updater/automounter_gonk.h
+++ b/toolkit/mozapps/update/updater/automounter_gonk.h
@@ -22,17 +22,17 @@ typedef enum {
  * Code inspired from AOSP system/core/adb/remount_service.c
  */
 class GonkAutoMounter
 {
 public:
   GonkAutoMounter();
   ~GonkAutoMounter();
 
-  const MountAccess GetAccess()
+  MountAccess GetAccess() const
   {
     return mAccess;
   }
 
 private:
   bool RemountSystem(MountAccess access);
   bool ForceRemountReadOnly();
   bool UpdateMountStatus();
--- a/tools/profiler/lul/LulCommon.cpp
+++ b/tools/profiler/lul/LulCommon.cpp
@@ -72,17 +72,17 @@ Module::~Module() {
 //
 class UniqueString {
  public:
   explicit UniqueString(string str) { str_ = strdup(str.c_str()); }
   ~UniqueString() { free(reinterpret_cast<void*>(const_cast<char*>(str_))); }
   const char* str_;
 };
 
-const char* const FromUniqueString(const UniqueString* ustr)
+const char* FromUniqueString(const UniqueString* ustr)
 {
   return ustr->str_;
 }
 
 bool IsEmptyUniqueString(const UniqueString* ustr)
 {
   return (ustr->str_)[0] == '\0';
 }
--- a/tools/profiler/lul/LulCommonExt.h
+++ b/tools/profiler/lul/LulCommonExt.h
@@ -80,17 +80,17 @@ using std::map;
 ////////////////////////////////////////////////////////////////
 // UniqueString
 //
 
 // Abstract type
 class UniqueString;
 
 // Get the contained C string (debugging only)
-const char* const FromUniqueString(const UniqueString*);
+const char* FromUniqueString(const UniqueString*);
 
 // Is the given string empty (that is, "") ?
 bool IsEmptyUniqueString(const UniqueString*);
 
 
 ////////////////////////////////////////////////////////////////
 // UniqueStringUniverse
 //
--- a/tools/profiler/lul/LulDwarf.cpp
+++ b/tools/profiler/lul/LulDwarf.cpp
@@ -1798,32 +1798,32 @@ void CallFrameInfo::Reporter::ClearingCF
                    " the DW_CFA_restore_state instruction at offset 0x%llx"
                    " would clear the CFA rule in effect\n",
                    filename_.c_str(), CallFrameInfo::KindName(kind), offset,
                    section_.c_str(), insn_offset);
   log_(buf);
 }
 
 
-const unsigned int DwarfCFIToModule::RegisterNames::I386() {
+unsigned int DwarfCFIToModule::RegisterNames::I386() {
   /*
    8 "$eax", "$ecx", "$edx", "$ebx", "$esp", "$ebp", "$esi", "$edi",
    3 "$eip", "$eflags", "$unused1",
    8 "$st0", "$st1", "$st2", "$st3", "$st4", "$st5", "$st6", "$st7",
    2 "$unused2", "$unused3",
    8 "$xmm0", "$xmm1", "$xmm2", "$xmm3", "$xmm4", "$xmm5", "$xmm6", "$xmm7",
    8 "$mm0", "$mm1", "$mm2", "$mm3", "$mm4", "$mm5", "$mm6", "$mm7",
    3 "$fcw", "$fsw", "$mxcsr",
    8 "$es", "$cs", "$ss", "$ds", "$fs", "$gs", "$unused4", "$unused5",
    2 "$tr", "$ldtr"
   */
   return 8 + 3 + 8 + 2 + 8 + 8 + 3 + 8 + 2;
 }
 
-const unsigned int DwarfCFIToModule::RegisterNames::X86_64() {
+unsigned int DwarfCFIToModule::RegisterNames::X86_64() {
   /*
    8 "$rax", "$rdx", "$rcx", "$rbx", "$rsi", "$rdi", "$rbp", "$rsp",
    8 "$r8",  "$r9",  "$r10", "$r11", "$r12", "$r13", "$r14", "$r15",
    1 "$rip",
    8 "$xmm0","$xmm1","$xmm2", "$xmm3", "$xmm4", "$xmm5", "$xmm6", "$xmm7",
    8 "$xmm8","$xmm9","$xmm10","$xmm11","$xmm12","$xmm13","$xmm14","$xmm15",
    8 "$st0", "$st1", "$st2", "$st3", "$st4", "$st5", "$st6", "$st7",
    8 "$mm0", "$mm1", "$mm2", "$mm3", "$mm4", "$mm5", "$mm6", "$mm7",
@@ -1832,17 +1832,17 @@ const unsigned int DwarfCFIToModule::Reg
    4 "$fs.base", "$gs.base", "$unused3", "$unused4",
    2 "$tr", "$ldtr",
    3 "$mxcsr", "$fcw", "$fsw"
   */
   return 8 + 8 + 1 + 8 + 8 + 8 + 8 + 1 + 8 + 4 + 2 + 3;
 }
 
 // Per ARM IHI 0040A, section 3.1
-const unsigned int DwarfCFIToModule::RegisterNames::ARM() {
+unsigned int DwarfCFIToModule::RegisterNames::ARM() {
   /*
    8 "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",
    8 "r8",  "r9",  "r10", "r11", "r12", "sp",  "lr",  "pc",
    8 "f0",  "f1",  "f2",  "f3",  "f4",  "f5",  "f6",  "f7",
    8 "fps", "cpsr", "",   "",    "",    "",    "",    "",
    8 "",    "",    "",    "",    "",    "",    "",    "",
    8 "",    "",    "",    "",    "",    "",    "",    "",
    8 "",    "",    "",    "",    "",    "",    "",    "",
--- a/tools/profiler/lul/LulDwarfExt.h
+++ b/tools/profiler/lul/LulDwarfExt.h
@@ -1198,23 +1198,23 @@ class DwarfCFIToModule: public CallFrame
   };
 
   // Register name tables. If TABLE is a vector returned by one of these
   // functions, then TABLE[R] is the name of the register numbered R in
   // DWARF call frame information.
   class RegisterNames {
    public:
     // Intel's "x86" or IA-32.
-    static const unsigned int I386();
+    static unsigned int I386();
 
     // AMD x86_64, AMD64, Intel EM64T, or Intel 64
-    static const unsigned int X86_64();
+    static unsigned int X86_64();
 
     // ARM.
-    static const unsigned int ARM();
+    static unsigned int ARM();
   };
 
   // Create a handler for the dwarf2reader::CallFrameInfo parser that
   // records the stack unwinding information it receives in SUMM.
   //
   // Use REGISTER_NAMES[I] as the name of register number I; *this
   // keeps a reference to the vector, so the vector should remain
   // alive for as long as the DwarfCFIToModule does.
--- a/widget/gtk/nsPrintDialogGTK.cpp
+++ b/widget/gtk/nsPrintDialogGTK.cpp
@@ -111,17 +111,17 @@ ShowCustomDialog(GtkComboBox *changed_bo
   gtk_widget_destroy(prompt_dialog);
 }
 
 class nsPrintDialogWidgetGTK {
   public:
     nsPrintDialogWidgetGTK(nsIDOMWindow *aParent, nsIPrintSettings *aPrintSettings);
     ~nsPrintDialogWidgetGTK() { gtk_widget_destroy(dialog); }
     NS_ConvertUTF16toUTF8 GetUTF8FromBundle(const char* aKey);
-    const gint Run();
+    gint Run();
 
     nsresult ImportSettings(nsIPrintSettings *aNSSettings);
     nsresult ExportSettings(nsIPrintSettings *aNSSettings);
 
   private:
     GtkWidget* dialog;
     GtkWidget* radio_as_laid_out;
     GtkWidget* radio_selected_frame;
@@ -338,17 +338,17 @@ nsPrintDialogWidgetGTK::OptionWidgetToSt
   NS_ASSERTION(index <= CUSTOM_VALUE_INDEX, "Index of dropdown is higher than expected!");
 
   if (index == CUSTOM_VALUE_INDEX)
     return (const char*) g_object_get_data(G_OBJECT(dropdown), "custom-text");
   else
     return header_footer_tags[index];
 }
 
-const gint
+gint
 nsPrintDialogWidgetGTK::Run()
 {
   const gint response = gtk_dialog_run(GTK_DIALOG(dialog));
   gtk_widget_hide(dialog);
   return response;
 }
 
 void
--- a/xpcom/build/PoisonIOInterposerBase.cpp
+++ b/xpcom/build/PoisonIOInterposerBase.cpp
@@ -33,18 +33,19 @@ FileDescriptorToHandle(int aFd)
 #endif /* if not XP_WIN32 */
 
 using namespace mozilla;
 
 namespace {
 struct DebugFilesAutoLockTraits
 {
   typedef PRLock* type;
-  const static type empty() { return nullptr; }
-  const static void release(type aL) { PR_Unlock(aL); }
+  typedef const PRLock* const_type;
+  static const_type empty() { return nullptr; }
+  static void release(type aL) { PR_Unlock(aL); }
 };
 
 class DebugFilesAutoLock : public Scoped<DebugFilesAutoLockTraits>
 {
   static PRLock* Lock;
 public:
   static void Clear();
   static PRLock* getDebugFileIDsLock()
--- a/xpcom/ds/nsIAtom.idl
+++ b/xpcom/ds/nsIAtom.idl
@@ -11,17 +11,17 @@
 %}
 
 /*
  * Should this really be scriptable?  Using atoms from script or proxies
  * could be dangerous since double-wrapping could lead to loss of
  * pointer identity.
  */
  
-[scriptable, builtinclass, uuid(1f341018-521a-49de-b806-1bef5c9a00b0)]
+[scriptable, builtinclass, uuid(8b8c11d4-3ed5-4079-8974-73c7576cdb34)]
 interface nsIAtom : nsISupports
 {
   /**
    * Get the Unicode or UTF8 value for the string
    */
   [binaryname(ScriptableToString)] AString toString(); 
   [noscript] AUTF8String toUTF8String();
   
@@ -43,17 +43,17 @@ interface nsIAtom : nsISupports
   inline bool Equals(const nsAString& aString) const {
     return aString.Equals(nsDependentString(mString, mLength));
   }
 
   inline char16ptr_t GetUTF16String() const {
     return mString;
   }
 
-  inline const uint32_t GetLength() const {
+  inline uint32_t GetLength() const {
     return mLength;
   }
 
   inline void ToString(nsAString& aBuf) {
     nsStringBuffer::FromData(mString)->ToString(mLength, aBuf);
   }
 
   inline nsStringBuffer* GetStringBuffer() const {
--- a/xpcom/glue/PLDHashTable.h
+++ b/xpcom/glue/PLDHashTable.h
@@ -300,17 +300,17 @@ public:
     *this = mozilla::Move(aOther);
   }
 
   PLDHashTable& operator=(PLDHashTable&& aOther);
 
   ~PLDHashTable();
 
   // This should be used rarely.
-  const PLDHashTableOps* const Ops() { return mOps; }
+  const PLDHashTableOps* Ops() const { return mOps; }
 
   // Size in entries (gross, not net of free and removed sentinels) for table.
   // This can be zero if no elements have been added yet, in which case the
   // entry storage will not have yet been allocated.
   uint32_t Capacity() const
   {
     return mEntryStore.Get() ? CapacityFromHashShift() : 0;
   }
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -255,43 +255,50 @@ struct nsTArray_SafeElementAtHelper
   elem_type& SafeElementAt(index_type aIndex);
   const elem_type& SafeElementAt(index_type aIndex) const;
 };
 
 template<class E, class Derived>
 struct nsTArray_SafeElementAtHelper<E*, Derived>
 {
   typedef E*       elem_type;
+  //typedef const E* const_elem_type;   XXX: see below
   typedef size_t   index_type;
 
   elem_type SafeElementAt(index_type aIndex)
   {
     return static_cast<Derived*>(this)->SafeElementAt(aIndex, nullptr);
   }
 
-  const elem_type SafeElementAt(index_type aIndex) const
+  // XXX: Probably should return const_elem_type, but callsites must be fixed.
+  // Also, the use of const_elem_type for nsTArray<xpcGCCallback> in
+  // xpcprivate.h causes build failures on Windows because xpcGCCallback is a
+  // function pointer and MSVC doesn't like qualifying it with |const|.
+  elem_type SafeElementAt(index_type aIndex) const
   {
     return static_cast<const Derived*>(this)->SafeElementAt(aIndex, nullptr);
   }
 };
 
 // E is the base type that the smart pointer is templated over; the
 // smart pointer can act as E*.
 template<class E, class Derived>
 struct nsTArray_SafeElementAtSmartPtrHelper
 {
   typedef E*       elem_type;
+  typedef const E* const_elem_type;
   typedef size_t   index_type;
 
   elem_type SafeElementAt(index_type aIndex)
   {
     return static_cast<Derived*>(this)->SafeElementAt(aIndex, nullptr);
   }
 
-  const elem_type SafeElementAt(index_type aIndex) const
+  // XXX: Probably should return const_elem_type, but callsites must be fixed.
+  elem_type SafeElementAt(index_type aIndex) const
   {
     return static_cast<const Derived*>(this)->SafeElementAt(aIndex, nullptr);
   }
 };
 
 template<class T> class nsCOMPtr;
 
 template<class E, class Derived>
@@ -308,28 +315,30 @@ struct nsTArray_SafeElementAtHelper<RefP
 
 namespace mozilla {
 template<class T> class OwningNonNull;
 } // namespace mozilla
 
 template<class E, class Derived>
 struct nsTArray_SafeElementAtHelper<mozilla::OwningNonNull<E>, Derived>
 {
-  typedef E*     elem_type;
-  typedef size_t index_type;
+  typedef E*       elem_type;
+  typedef const E* const_elem_type;
+  typedef size_t   index_type;
 
   elem_type SafeElementAt(index_type aIndex)
   {
     if (aIndex < static_cast<Derived*>(this)->Length()) {
       return static_cast<Derived*>(this)->ElementAt(aIndex);
     }
     return nullptr;
   }
 
-  const elem_type SafeElementAt(index_type aIndex) const
+  // XXX: Probably should return const_elem_type, but callsites must be fixed.
+  elem_type SafeElementAt(index_type aIndex) const
   {
     if (aIndex < static_cast<const Derived*>(this)->Length()) {
       return static_cast<const Derived*>(this)->ElementAt(aIndex);
     }
     return nullptr;
   }
 };